adding Adsense code to the theme files

I want to add Adsense code underneath my header on my site,

I would like it to look very similar to another one of my sites:

I don't that an Adsense plugin exists which allows you to add the code to the header, footer and side widget areas as well as the more conventional pages on a post / page.

Also, it'd be nice to be able to turn Adsense on or off for each individual page. Anyway, those are features you can add to the next generation of Adsense plugins.

For now, I'll settle for the line # where I need to put my Adsense code as well as an example of the exact code that accompanies the Adsense code.

  • aecnu
    • WP Unicorn

    Greetings reese_richards,

    Welcome to WPMU DEV!

    Thank you for bringing this item to our attention in which there are many possible solutions for this and possibly some combinations to get the total effect you described.

    There is In Post Ads plugin for posts or perhaps better yet Simple Ads plugin for this task.

    There is also Ad Widget plugin for the widget area and Global Footer Content plugin for the footer.

    Regarding the header and without knowing what theme you are referring to, have you tried hard coding it into the heade.php file right below the existing code?

    Let us know how it goes.

    Cheers, Joe

  • reese_richards
    • WPMU DEV Initiate


    Thanks for the response. Unfortunately none of the plugins you mentioned fit the bill. None of them allow you to put ads in the header.

    I have put the Adsense code in the header on one of my WP sites by adding the code to the header.php file. The problem, however, is that I can't get it to show up where I want it to.


    If you look at that site, the Adsense code is on the top of the header. I want it near the bottom of the header. I've played and played with it - had it once and (don't ask), ended up deleting it and can't find where to put it again.

    Is there any hard and fast rule of where to put the code in the header.php template? Like "before the closing /whatever tag"



Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.