Really stupid question about ad code!

5 replies
Just trying to turn one of my wordpress sites into an adsense site.

Where am I meant to insert the adsense code???

And will it work with any theme on wordpress??
#code #question #stupid
  • Profile picture of the author JohnMcCabe
    Laurence, there are plugins that will manage your Adsense code for you. Or, if you dare to muck around a little in the template code, you can insert it yourself.

    For example, if your theme has a template called "singlepost.php", that will be used to display your individual posts or articles.

    Within that template, you will see a combination of html statements and php code with WP markers in it. If you spend a little time on the Wordpress site in the Docs section studying how "the loop" works, you'll see where to paste your code according to where you want the ads to show.

    Main Page WordPress Codex

    The Loop WordPress Codex

    For example, if you wanted to display your ads between the article title and body, you would look for something like this:
    Code:
    [Insert AdSense code here]
    <div class="entry">
       <?php the_content(); ?>
     </div>
    and paste your AdSense code right above it. Save the changes and check one of your posts. You should see the ads where you want them.

    One warning...

    Before you start mucking around in the template code, make a copy of the original so that if you screw things up, you can simply paste in the original and start over.
    {{ DiscussionBoard.errors[1574959].message }}
  • Profile picture of the author LesleyJohnston
    I use All in One Adsense and YPN plugin for some of my WP sites, it's very easy to install and you can choose whether you want adsense to show on your home page or not, as well as how many/what size ads you want to appear on each page.
    Signature
    Get Your FREE PLR Pack at eBusinessPLR.com
    Need Ghostwritten articles? I've got a special deal here that might interest you.

    NEW WSO - Bumper WordPress PLR Articles & Reports Pack
    {{ DiscussionBoard.errors[1574975].message }}
  • Profile picture of the author Nickolie0990
    There are many plug-ins you can use, just do a Google search and find the best one that fits your blog. Some plug ins even allow you to put in different codes in and have it rotate the code with each new page view.
    {{ DiscussionBoard.errors[1575007].message }}
  • Profile picture of the author laurenceh
    Many thanks guys

    One thing I did forget to ask is how long roughly does it take for Google to decide what ads are relevant to the site?

    Firs adsense experience!
    {{ DiscussionBoard.errors[1575297].message }}
  • Profile picture of the author laurenceh
    One thing I did forget to ask is how long roughly does it take for Google to decide what ads are relevant to the site?

    Firs adsense experience!
    {{ DiscussionBoard.errors[1575366].message }}

Trending Topics