Recently while working on a very secret project, we found a need to show comments on the homepage of the site. Normally, on single pages you can just call comments_template(); and it should display, but it wasn’t showing up. All we ended up getting was a blank div container. After doing a quick search online, we were able to find the answer. In this article, we will show you how to show comments on the homepage of your WordPress site.
Inside the loop right before endwhile, simply add the following code:
<?php $withcomments = "1"; comments_template(); // Get wp-comments.php template ?>
A single line $withcomments makes all the difference.
Note: this was a very simple one page site we threw up. So the theme elements were style.css, index.php, and comments.php file. We were calling a loop to display a specific page on the index.php file along with other things.
We hope that this would help some of you. Some of you may even have a better way of doing this. If you do, please share it with us in the comments.








Thank you! The $withcomments = “1″; bit was exactly what I needed.
Use:
comments_template(“/comments.php”, true);
otherwise it just repeats the first posts comments for every post.
Yes!! Thanks for this additional tip, this was driving me crazy.
Great tip, thanks for posting about it too. I’ve noticed questions about this in the WordPress Support forums a few times with no answer given, so this will no doubt help quite a few people
Nice tip !
Thanks… let’s me try it
Just starting with wp so yes i need it thanx
Cool tip. At long last, I’m beginning to dig a little deeper into the WordPress code. I’ve subscribed to your weekly updates! dragonblogger mentioned your blog today and then I saw this tweet in my Gmail (I use @Rapportive)
Cheers,
Mitch