WordPress: How to place ad slot after first post only

by Saad Irfan

WordPress Plugins are one of most easy way to integrate any outer stuff in your blog, but if you have inspiration about the script of your need then why go for Plug-in. however installing lots of Plug-ins are also not healthy for your site. So always have a preference of simple scripts instead of Plugins if you can. I know some of you might contradict this idea.

There are lots of ways to display ad slot after first post in WordPress, and here I am going to give one of simplest way to display ads after first entry. Do give it a try, if because of some function problem you are unable to execute that script. Go for other, there so many other methods available as well.

Go to your WordPress theme folder and look for file name “index.php”

Open the file and hunt the line

<?php endwhile; ?>

Once you find the line, place the code given below just before the code given above.

<?php if(!$show_ads){ ?>

Put your code here……


<?php $show_ads = 1; } ?>

If you are looking ahead for placing Google ad in that place, ad slot of 468 width and 60 height is suggested

Thanks to Maria Khan from Cambridge  to guide me for this script