Since 2001, we've posted 20,585 different business opportunities and ideas, so you're sure to find something here to inspire you!

StepNpull: Open Doors Hands Free

StepNpull: Open Doors Hands Free

Read more...

Vote For Your Favorite .biz Domain – Hint! Hint!

Vote For Your Favorite .biz Domain – Hint! Hint!

Read more...

Q&A With Christmas Caroloke Creator

Q&A With Christmas Caroloke Creator

Read more...

   

How to Show Recent Comments After the First Post

A reader wrote:

Dane, how do you place advertisements (or other content) after the first (and subsequent) posts on your blog?

Something I’ve done with my blogs for a long time is to place a variety of different content after different posts on the front page. For instance, on all of the Business Opportunities Weblog blogs I’m showing a list of recent comments immediately after the first post on the home page. This is very easy to accomplish with only a simple change to your WordPress templates.

In your index.php template, inside the loop, below your post tags and above the “endwhile” add this:


$adcounter = $adcounter+ 1;
if ($adcounter == 1) { }
if ($adcounter == 5) { }

To put something in the space immediately below the first post, where I put my recent comment list, put it in the brackets after $adcounter == 1. To put something after the fifth post, put it inside the brackets after $adcounter == 5.

Here’s my code:

With this technique, it is possible to put ads or other unique content after every single one of your blog posts.

Have fun.

   

Related Businesses in the Directory

Related Posts

Related Resources

Today's Posts