Ads after the first post in wordpress on homepage
Have you ever wondered how to place ads after the first post in wordpress ? You want to get the ads between the first and second post ? Then read on to see how it is done. I promise it is quite simple.
One of the more effective places to implement Google Adsense is after the first post. My personal favorite is the 336×280 after the 1st post. You will also see that the CTR for ads in this spot is usually higher than placing it on the sidebar.
Step 1 :
Open up index.php or home.php in your favorite Editor.
Step 2 :
Look for
<?php if (have_posts())
and add this before that line
<?php $count = 1; ?>
What It Does :We are adding a counter so that we can call the ads after say x number of posts
Step 3 :
Now you have to find
<?php the_content
and immediately after that , add:
<?php if ($count == 1) : ?> REPLACE THIS WITH YOUR ADSENSE CODE <?php endif; $count++; ?>
What It Does :We are asking wordpress to inject the Adsense Ads when the counter is set to 1, as so now we get the ads after the 1st post. want it after the 3rd post ? change $count == 1 to $count == 3
TIP : Want to add ads after the 1st 2nd and 3rd post ? Replace
<?php if ($count == 1) : ?>with
< ?php if ($count == 1 || $count == 2 || $count == 3) : ?>
One key point to note is that this hack should go inside the loop otherwise it won’t come out the way you want it.
Hope this helps you guys. If you are having any issues with this feel free to use the comments section for help.






Comment by Cooper Foster on 5 October 2010:
who does not want to Make Money Online anyway? everyone loves it,~-
Comment by Garden Lighting · on 4 November 2010:
movie trailers on youtube are so cool, they even got trailers of the latest movies “
Comment by Necklace Holder · on 4 November 2010:
sometimes windows7 won’t install if you install it on a pc with a previous installation of windows XP “
Comment by Bed Guard on 3 December 2010:
i always watch moview trailers on youtube, it is really fun to watch so many movie trailers at once ~’:
Comment by Austin Cook on 4 December 2010:
well, i have troubles installing windows7 on my PC. maybe i need a bios update or something ““