Building websites with WordPress is easy until you have to start editing the code behind the website. However this is necessary in order to add AdSense code into your posts as it lines it up nicely. This means it will automatically be added to every post you create in your WordPress website. If you add AdSense into your templates you will not have to touch it again and the less you play with the code of your website, the better. I will show you how to add AdSense to your posts so it will line up with the text, embed itself, and look like it is meant to be there.
- Sign into your WordPress Admin area.
- Click on the Appearance menu.
- Then click on Editor. See the screenshot below.
- You will be taken to the WordPress code editor. Click on Single.php in the right column. See the screenshot below.
- When the single.php code shows up you can copy all of it and paste it to a notepad, just in case you stuff something up. This is very important. Do not move any text or even add a space where it is not meant to be. Just copy it and make a quick backup of the code. You can press in the code box and then press CTRL + A to select all. Then right click on the selection to choose copy.
- Ok after you have backed up this code we can now add something to it. Look for where the content begins. The code will look something like this <div class=”postcontent”>
- We are going to add our code before this.
- Here’s the code
- <div style=”display:block;float:left;padding:5px;”><add your adsense code here></div>
Sometimes you might need to put <p> and </p> tags to make a paragraph around all of this. It really depends what WordPress theme you are using. As you can see in the screenshot above, I have used the <p> tag. On some websites I do not have to.
When you are finished adding your AdSense code in press on the update button below the code window.
If you have backed up your code you can keep adjusting this until you get it right. Then if you can’t work it out, just paste the original code back in and press on update to save. When playing with the WordPress code editor make sure you are not cutting code when you are meant to be copying it…Anyway you shouldn’t have to worry if you make a backup.





{ 19 comments… read them below or add one }
Thanks for this tips, this works like charm on my bookmarking website. The idea of implementing style with div tag is great.
Madhav Tripathi recently posted..What to do if Add-ons are disabled after updating Firefox?
Not bad. What I usually do is get a plugin to do it for me. Quick Adsense is the name of the plugin.
Its really great to use.
Kharim recently posted..CommentLuv Premium – One Of The Best Thing That Happened To This Blog
Under Appearance, I don;t have the Editor Tab?? Using Bueno Theme by Woothemes. Anyone here who could possibly help? Thanks!
Maybe woo themes has its own place to put adsense?? Not sure though as I don’t use them?? You could try the Woo themes website for support..
Nice tricks! we can also insert adsense ads into the post using “post layout” plugin.
Marks recently posted..Building Link Popularity For Blog
nope actually i did n’t find ur code
on my Single.php file so how can i add further codes so plzz help me out Shall i provide my Single.php codes here so tht u can modify them!
i did n’t find this code in my SIngle.php file and by putting your Given Code I get ads Below post title not in between post contents please help me Out!
So did you did you add the padding code or just the adsense code?
Never thought about it. plugins will slow my site down. I should start to look into learning some more code.
Great insight Mitz!
Danny Strampel recently posted..Remington RM1015P 10-Inch 8 Amp Electric Pole chain Saw
I have been using the wordpress plugin called WhyDoWork Adsense for a couple years now and it’s worked great for me. It allows you to put Adsense code (or any other ad code from other networks) into your posts.
Hi Paul
Thanks for the great tips…Can you please use your name@keyword as I am starting to ban anyone that does not do this…We like to know who we are talking to..
There are a lot of free plugins that set this up nicely if I recall. I’m not going to play favorites, but a general search for adsense on the plugin list can find you a winner. If there’s a plugin I can add to do something, I refuse to run the risk of fouling up code.
Anthony recently posted..Acne Diets-Let’s Get Real
Ah yes but in the end it is better to add the code because too many plugins slow your site down… I use the plugins until I can figure out how to do something myself.
Hi Mitz,
Thank you very much for sharing,it was helpful.
Cheers,
Kebabope Morapedi
kebabope recently posted..Attraction Marketing,Is It Worth The Trouble?
At me this isn’t working. I don’t have the add theme option. Can you help me?
i have a blogroll account and i have reason to believe it is similar to wordpress or related but i just can’t seem to find where i can add adsense, a little help?
wakarima recently posted..a list of things i hate
If it is a free wordpress blog then you cannot add adsense like this…I don’t think you can anyway, unless things have changed.. This is for people who have installed Wordpress on their own server or hosting.
That is such a good resource you are offering and you’re giving it away for free. I honestly appreciate seeing sites that comprehend the value of providing a useful resource for absolutely free. I genuinely enjoyed reading through your post
Thank you
I’ve been following your blog for 2 days now and I should tell you I get tons benefits from your post. and now how I can get news update from your website?
{ 1 trackback }