To display the total number of comments, Trackbacks, and Pingbacks for a post, use comments_popup_link or comments_number tags.
These tag must be within The Loop.
Use comments_popup_link. Will not work if in a page or single post.
<?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>
Use comments_number.
<?php comments_number('No Comments', 'One Comment', '% Comments'); ?>
Enter your email below to receive posts direct to your inbox. I promise that I will not share your details and e-mail address with any third party. I will not send you unwanted e-mail.
Your email address will not be published. Required fields are marked *
Name *
Email *
Website
Comment
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Notify me of follow up comments via e-mail.
Subscribe.Enter your email:
How to display the number of comments in WordPress
To display the total number of comments, Trackbacks, and Pingbacks for a post, use comments_popup_link or comments_number tags.
These tag must be within The Loop.
In index.php or archive.php
Use comments_popup_link. Will not work if in a page or single post.
In single.php or page.php
Use comments_number.
Related