I stumbled upon this very handy guide on how to insert an adsense ad unit after the first post on your wordpress blog.
To do this you will need to be able to edit the template files, specifically the “index.php” file.
The guide uses a simple PHP if statement to count the number of posts and insert the adsense code after the first post (or second or third etc).
Open up the template file index.php in your favourite text editor and add this to the top.
In the index file there is a “while” loop that grabs all the needed wordpress posts.
It starts with this
and ends with
Just before this “endwhile” statement, we need to add some code.
And your done!
Read more about tips on adding Adsense to your blog.
No related posts.