I was using a wordpress google adsense plugin to add google ads to this blog before I saw something that eventually made me change my mind about adsense plugins. I finished writing a post that day, previewed it and saw one of my ad units in a color I never used. Knowing what could be wrong, I checked the publisher’s ID and saw it was totally different from mine! It was only then I realized I had been sharing my revenue with the plugin developer without my knowledge. It was at that very moment I decided not to use anymore wordpress google adsense plugin and tried inserting ad units manually.
Adding Google Ads below the Menu
- Go to Appearance > Template Editor
- Open header.php
- In the very last line, paste this code:
YOUR ADSENSE CODE HERE
</div>
I used this to add a 728×90 leaderboard below the header, see that? You should note the following:
width:950px – this represents your blog width. You should increase or decrease this if there’s a need to do that.
background: #ffffff – this is the default background. If you have a dark you should change the color code to 000000
YOUR ADSENSE CODE HERE – Paste your adsense code here
Adding Google Ads below Post Title
- Open single.php
- Locate where the post body starts. If your theme supports thumbnails, it shoul be just before this code:
if(has_post_thumbnail()) {
- Paste your adsense code just before this.
- If your theme dosn’t support thumbnails, you should paste your adsense code just before this:
the_content('');
Below is what it should look like:
Adding Google Ads Before Comments
Locate this code in single.php and add the code just before it:
if(comments_open( get_the_ID() )) {
comments_template('', true);
Adding Goolge Ads on the Sidebar(s)
- You don’t need to edit your template to do this, just go to Appearance > Widgets
- Drag Text widget to your desired position and paste your code inside it.
Google Adsense in Other Positions
If you’re not comfortable with editing your template, there’s a way out.Udegbunam Chukwudi of Patchworkoftips introduced a plugin to me. This plugin’s not an adsense plugin but rather a plugin to define how your post layout looks like. Post Layout allows you to use all sort of text, html, javascript anywhere in your posts and I recommend it.


Thanks for this update, have been expecting a post on this earlier but had a work around pasting my ads below post. Geez most of this plugin developers are crooks!!! Myself never intended using a plugin for my ads before. Thanks once again for this update! Cheers
You’re much welcome, Enchant.
thanks for this post.
You are really the ‘don’
Twitter: trueinternet
says:
thanks don, works perfect! but is there a way to align the ads below post title to left or right?
book on blogging recently posted..Understanding Blogging : What you need to know about the business
If you want to wrap your text around the ad unit, use this:
<div style="float: left; padding: 5px; margin: 5px;">ADSENSE CODE HERE</div>You can change float: left to float: right.
I can’t see single.php in the themes in editor, any alternative way, Help
I am not seeing the above mentioned code in my Genesis Single.php file..
any help will be much appreciated..
I wrote this post before I started using Genesis so it probably won’t work. You may have to use POST LAYOUT PLUGIN
Twitter: xlimderek
says:
Sir i use a genesis child theme and i coudn’t find Template Editor under appearance
Derek recently posted..Top 5 Must-Have Gadgets
Twitter: elect5
says:
Hi,
Is it also possible to use “Genesis Simple Hooks” plugin for Adsense codes?
Thanks,
Marko
Marko recently posted..Netbooks Under 200 – How To Replace The Screen On Netbook
Yes, you can. It’s what I personally use.
Twitter: moneyhomeblogg
says:
thank you for this code, i was able to add it to my website in less than 2 minutes.
money home blog recently posted..Making money online with taggify.net, is it possible?