Display the number of comments on each wordpress post

December 16, 2008 · Print This Article

How we can display the number of comments for each posts? While some themes do it by default, most of them don’t display it at all.

To solve this problem, simply open your index.php file and paste the following code within the loop:

<?php comments_number('No comments yet','1 comment','% comments')?>

Even better, following code have a link to jump directly to the comments:

<a href="<?php the_permalink() ?>#comments"><?php comments_number('No comments yet','1 comment','% comments')?></a>

Your choice for site templates and wordpress themes


Got something to say?

You must be logged in to post a comment.