Posted in WordPress · December 28th, 2010 by Kazim · Comments (3)
As you see Homepage of my website. I’ve a banner advertise after first post. It doesn’t mean which ever post you’ve this trick let you allow to add it after your first post. Sometime you want to insert ad after first post and you do it by inserting your ad code in WordPress Loop. Next you found is that it is showing after each post. Obviously we can’t afford to have that much ads on Homepage, neither Google Adsense as per their TOS allow us to do it. As by alternative to be preferred is banner ad placement after first post on your blog homepage. Either this trick also work if you want to place something else you would like to after first post. Below is quick tip to show anything after first post in WordPress.
<?php endwhile; ?>
<?php if(!$show_ads){ ?> Your Ad Code Here <?php $show_ads = 1; } ?>
Simply you will have to replace Your Ad Code Here with your Adsense Code or whatever you’d like to place after first post.
Credits shall be to thee: WpHacks
April 8th, 2011 at 3:55 PM
[...] en Khapay Tags: Blogging, [...]
April 9th, 2011 at 1:40 PM
[...] Visto en Khapay [...]
April 11th, 2011 at 3:23 AM
[...] Khapay (Sin votos) Loading [...]