Forums

add adsense code or same text at the end of all past posts (4 posts)

  1. adambra
    Member
    Posted 11 months ago #

    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!

  2. adambra
    Member
    Posted 10 months ago #

    no one can help me?

  3. keesiemeijer
    moderator
    Posted 10 months ago #

    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');
  4. poddys
    Member
    Posted 10 months ago #

    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?

Reply

You must log in to post.

About this Topic

Tags

No tags yet.