In this article, we will provide you guide so that you can display the total number of comments in WordPress:
Method 1: Display WordPress Comment count with a plugin
Inorder to display WordPress comment count with a plugin, follow the steps below:
Note: you can use this code in any WordPress post, page or text widget.
Method2: Display WordPress comment count with code
This method could be quite difficult for you as you need to add code to your WordPress site. But still, if you want to display comment count without the use of plugin then you may follow the steps below:
[php]
function ibsam_comment_count() {
$comments_count = ibsam_count_comments();
$message = ‘There are ‘. $comments_count->approved . ‘ comments found.’;
return $message;
}
add_shortcode(‘ibsams_comment_count’,’ibsam_comment_count’);
add_filter(‘widget_text’,’do_shortcode’);
[/php]
Note: this code creates a function that outputs total number of approved WordPress comments on your site.