Ad display problem
-
Resolved
I have the following code added to the index.php file of the Default WordPress theme:
—————————
global $css_display, $ad_is_displayed;
$str_content = str_the_content(‘Read the rest of this entry »’);
$word_count = str_word_count($str_content);if($word_count > 300 && ! $ad_is_displayed)
{
$css_display =”;
//display ad only once
$ad_is_displayed = true;
}
else
{
$css_display=’style=”display:none;”‘;
}//print(“<p>Word Count: $word_count </p>”);
?>
——————————–Basically I want an ad displayed if a post has 300 or more words. It works great for my homepage, but for some reason on my archived pages or individual pages for blog posts (if you click the title), the ad won’t show up. Any help with this would be greatly appreciated.
My blog is https://www.thinkmulticultural.com and the ad tag I am using is
<iframe src=”https://c5.zedo.com/jsc/c5/ff2.html?n=595;c=121/1;s=79;d=9;w=300;h=250″ frameborder=0 marginheight=0 marginwidth=0 scrolling=”no” allowTransparency=”true” width=300 height=250></iframe>
- The topic ‘Ad display problem’ is closed to new replies.