@ Admin :
Is there a way to implate adsense banners beneath every post ? Can I use “[ad code=4 align=center]” for this ? I do not want to type it beneath every post.
Thanks
@ Admin :
Is there a way to implate adsense banners beneath every post ? Can I use “[ad code=4 align=center]” for this ? I do not want to type it beneath every post.
Thanks
anyone ?
advanced > user functions:
function insert_post_ads($content){
$content .= do_shortcode("[ad code=4 align=center]");
return $content;
}
if(is_single() || is_page()){
add_filter('the_content', 'insert_post_ads', 4);
add_filter('get_the_excerpt', create_function('','remove_filter("the_content", "insert_post_ads", 6); return;'), 5);
}Thanks for your response!
I pasted my adsense code in Ad code #4 and I also pasted the code you copied above in my user functions but nothing happens when I create a new post ?
this one should work:
<?php
function insert_post_ads($content){
if(is_single() || is_page()) $content .= do_shortcode("[ad code=4 align=center]");
return $content;
}
add_filter('the_content', 'insert_post_ads', 4);
add_filter('get_the_excerpt', create_function('','remove_filter("the_content", "insert_post_ads", 6); return;'), 5);Thank you very much, everything works fine now.
digitalnature,
This works, but only for single post view. How to get the ad to show up for all views? My Mystique setting is to display the complete post in all views. Thanks.
I'd like to posts the adsense banner BENEATH the posts's TAGS so the design will look more cleaner. Don't really know what to adjust in the code showed above.
This topic has been closed to new replies.