Support » Themes and Templates » Mystique Theme vs adsense banners

  • Resolved Driezzie

    (@driezzie)


    @ 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

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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.

    pooruncle

    (@pooruncle)

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Mystique Theme vs adsense banners’ is closed to new replies.