FacebookTwitter

How to Insert Adsense After First Post in WordPress

By on Dec 14, 2010 in Wordpress Tutorials |

Share On GoogleShare On FacebookShare On Twitter

adsense wordpressHave you ever wondered how to insert adsense after only first post in wordpress if so today we have come up with the solution for same.

Its highly asked question that how to insert adsense after first post in wordpres its very very simple.Just follow the instructions below and you are done.

Simply edit index.php file of your theme and look for the following code:

 <?php endwhile; ?>

Immediately before this code, place the following code:

<?php if(!$show_ads){ ?>
Insert Code Here
<?php $show_ads = 1; } ?>

This works fine when its allowed to show only 3 Adsense ads on a page so you can show one after first post, one in sidebar and another one in header.