• Hello,
    i recentrly changed my hosting provider so I’m re-adding all the things I lost because they weren’t in the backup file.
    Concerning adsense I would like to know how to add the same adsense code or text “[adsense]” at the end of all my past posts.
    I tried several plugins without success, with one of them: add-post-footer I can see the google ads when I click on the post but the ad doesn’t display on the home page of the blog even if the post is short and is all available on the home page.
    Could you please help me telling what I have to do?
    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter adambra

    (@adambra)

    no one can help me?

    Moderator keesiemeijer

    (@keesiemeijer)

    try this in your theme’s functions.php:

    function add_my_adsense_code($content) {
      return $content.'[adsense]';
    }
    add_filter('the_content', 'add_my_adsense_code');

    Adsense Integrator works pretty good.

    Since the post page only exists when it is viewed, you only have to set up ads at the end of each post in the plugin.

    Just a thought. If your old posts are not showing the adsense code, could you be viewing a cached copy?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add adsense code or same text at the end of all past posts’ is closed to new replies.