WordPress Hack: Banner After First Post
I have had many people ask me how I manage to add an Adsense banner unit after the first and before the second post on my homepage, which is something that I do on some of my other blogs. I can now reveal to you how it is done, and how you can implement it into your wordpress blog.
First you will need to locate the index.php file for the theme that your blog is currently using.
Depending on whether you show full articles or excerpts on your homepage you will be looking for something slightly different.
If you show excerpts on your homepage you need to look for the following (or Similar):
[sourcecode language='php']
[/sourcecode]
If you show full articles on your homepage you need to look for the following (or Similar):
[sourcecode language='php']
[/sourcecode]
This is the code that displays you posts on the homepage, with a read more link in most cases.
Now you have found this piece of code, you need to add the following code below it:
[sourcecode language='php']
!!YOUR AD CODE GOES HERE!!
[/sourcecode]
You need to add your Adsense code to the above code, then save the changes. You are done, this small piece of code will show your ads after the first post on your blogs homepage.




POYTSPOT | March 14th, 2008 at 11:32 pm #
hey thank you for this, i’ve been looking this technique since I started blogging… thanks…
David Shaw | March 16th, 2008 at 10:48 am #
Thats ok.
I was looking for it as well, then I just decided to do it myself!
Adriana | May 20th, 2009 at 11:47 am #
Great tip!
maike | May 20th, 2009 at 8:49 pm #
thank you *
Vygantas | June 11th, 2009 at 4:42 pm #
Doesn’t work
Marc Shaw | October 15th, 2009 at 3:51 pm #
Hey, I read a lot of blogs on a daily basis and for the most part, people lack substance but, I just wanted to make a quick comment to say GREAT blog!…..I”ll be checking in on a regularly now….Keep up the good work!
- Marc Shaw