I have page on wordpress site
http://upsourcemobileservices.com/solutions/
in footer.php I have added the following:
if(is_page('solutions')){
echo str_replace("The MVNi","The MVNi solution was created to ensure that wireless communications are available to the smaller Telco operators.","The MVNi");
}
but it is not changing the contents of the page.
To my knowledge, Syntax is correct str_replace(find,replace,string)
What am I doing wrong?
I also tried using jQuery
function replaceText(jQuery) {
$(".portfolio-thumbnail-content:nth-child(1)").replaceWith("<div class='portfolio-thumbnail-content'>The MVNi solution was created to ensure that wireless communications are available to the smaller Telco operators.</div>");
$(".portfolio-thumbnail-content:nth-child(2)").replaceWith("<div class='portfolio-thumbnail-content'>Primarily aimed at existing Telcos our MVNc solution integrates your existing platforms with ours through the use of APIs.</div>");
$(".portfolio-thumbnail-content:nth-child(3)").replaceWith("<div class='portfolio-thumbnail-content'>UMS turnkey solution is a complete MVNO in a box.</div>");
$(".portfolio-thumbnail-content:nth-child(4)").replaceWith("<div class='portfolio-thumbnail-content'>This solution allows you to select the products and services that you want and integrate them with your existing platforms.</div>");
}
$(document).ready(replaceText);
but can't seem to get that working either, here's a fiddle http://jsfiddle.net/vzy9R/3/
I used jQuery eq()
selector to find elements containing class portfolio-thumbnail-content and then using .replaceWith()
I was able to load my teaser content (excerpts) ending with complete sentences.
For example, the About page:
(function ($) {
$(".portfolio-thumbnail-content:eq(0)").replaceWith("<div class='portfolio-thumbail-content'>This is my new complete sentence teaser for Team.</div>");
$(".portfolio-thumbnail-content:eq(1)").replaceWith("<div class='portfolio-thumbail-content'>This is my new complete sentence teaser for Partners.</div>");
})(jQuery);
Then I had to figure out a way to implement those scripts into the body of those pages, so I wrote my own shortcodes and added them to functions.php
//[replaceTextAbout]
function replaceTextAbout_func( $atts ){
return "<script src='/javascript/custom/replaceText-About.js'></script>";
}
add_shortcode( 'replaceTextAbout', 'replaceTextAbout_func' );