Show Comments on the Front Page (main page / index.php) of Wordpress

Ever want to show your post comments on the front page of your Wordpress Blog? You know, the actual main page of you Blog, not some deep url nobody will ever remember?

Well, with this simple modification to your index.php file found in your current theme directory - you can.

Now mind you, if you have a lot of comments, this isn’t for you.  Why?  Because in that case your front page may run down a mile or two of page view with 50 comments. Presently for me, that’s not an issue.

Personally I like seeing everything displayed on the front page. I really don’t like landing on a home page, viewing a post, then clicking the “comments” to view the post and comments on a separate (single) page. I’d rather scroll through the posts and their comments all at one time. Sometimes the comments are better content then the actual post! Besides, by having comments and the ”leave a comment” box right in front of a visitor, I would think folks may be more likely to leave you their comment too.

I couldn’t find a plug in anywhere to do what I wanted, but do not fear, these two little snippets of code are easy to install and get the job done nicely and swiftly.

Here ya’ go:

Find your index.php file inside your current theme directory. This is the file we’re going to edit. Once you open the index.php file, copy the entire contents to a notepad .txt file for backup before we alter the actual index.php file.

So far? Now in the index.php file….

Find this code:

<?php get_header(); ?>

Below it add this code:

<?php $withcomments = 1 ?>

It should look like this now:

<?php get_header(); ?>

<?php $withcomments = 1 ?>

So Far? Almost done….

Find this code:

<?php endwhile; ?>

Above it add this code:

<?php comments_template(); ?>

It should look like this now:

<?php comments_template(); ?>

<?php endwhile; ?>

Save the file, you’re done.

Told you it was easy. If you run into some problems because you have some kind of super custom altered theme, or it’s not what you thought you wanted - you have the contents of that notepad file you created before you began. Copy and paste those contents back to your index.php file and you’re right back where you started.

Hopefully this helped you, I know it’s exactly what I want for now on this Blog. Maybe since you’re reading this, you’ll leave me a comment? It’s right there below.

Don’t forget to check out: WordPress Affiliate Pro - The BOMB for WordPress! The “BOMB” for WordPress!

L2 Lumpy

Recent Entries

7 Responses to “Show Comments on the Front Page (main page / index.php) of Wordpress”

  1. Steffen Says:

    I would like to only show 3 of the latest comments for each post with a more button for all of them.

    Is there an easy way to do that?

  2. admin Says:

    I don’t have the fix for that off the top of my head, but I’ll look into it a little later this week….

    I’m sure there’s a way to do it, just have to spend some time at the coding.

    L2 Lumpy

  3. sears Says:

    Hello, I can’t understand how to add your blog in my rss reader.

  4. admin Says:

    Have you tried adding http://feeds.feedburner.com/WheresLumpy or XML version http://www.whereslumpy.com/feed/

    Did that help?

    L2 Lumpy

  5. DP Says:

    Thanks for this!

  6. admin Says:

    You’re welcome. Thanks for dropping a comment.

    L2 Lumpy

  7. web7x24 Says:

    Today I learned something new. Thanks.

Leave a Reply

Site Webmaster - Where's Lumpy?
FireStats icon Powered by FireStats