E-Mail:
Author Avatar

Displaying Google Ads After Article Previews on the Main WordPress Page

So I recently emailed Chris Pirillo because I liked the way he has his site setup on the main page. He has a google ad below the 2nd, 5th and 8th articles displayed on his home page. Like Chris Pirillo, I use WordPress to manage my personal web site and I was wondering how he did this. Chris Pirillo (There, I said his name 3 times so he will appear and see this) unfortunately is way too busy to address my email, so I set out to find out on my own. I wanted to find the plug-in that did this for me, but I couldn’t find anything. I was already using the Adsense Manager plug-in to serve my ads on each page.

After a few days of searching, I finally figured that this isn’t accomplished using a WordPress plug-in. This had to be accomplished with PHP. So I modified the Main Index Template using the Theme Editor. Below the Read More function I put:

<?php if ( $i == 1 || $i == 4 || $i == 7 )
adsensem_ad(’adname’);
$i++; ?>

Now my page looks just like Chris’s and every main Lockergnome page as far as displaying a 250 x 250 ad box after the 2nd, 5th and 8th articles.

What Do You Think?

 


Anti-Spam Image

Want to Start a Blog Here for Free?

Are you an expert in one subject or another? If your goal is to help others and dispense hard-earned information back to the community, stake a claim on your very own Lockergnome blog today! You can write about anything - no matter the topic. Sign-up to start blogging!