Display the Total Comments Count in WordPress

How to Display the Total Number of Comments in WordPress
If you have a good number of comments on your WordPress blog, and want to show your users the same, you can do this by simply following the tutorial above.
If you have huge number of comments on your blog you can display total number of comments on your WordPress blog's footer or sidebar.
This can encourage users to read other posts also and may increase your pageviews.

Displaying Total Number of Comments in WordPress Sidebar

It's very simple just open your sidebar.php file, and paste the following code where you want to show off comments count:

<?php 
$comment_count = wp_count_comments();
echo $comment_count->approved . " Comments, Your custom message here";
?>
you can change "your custom message here" to anything you want to add or delete it.
If you want to add it in footer just instead of editing sidebar.php edit the footer.php file.

Feel  free to ask for any help regarding this tutorial in comments.

Comments

Popular posts from this blog

Show Full Post on Front Page of Ghost, Not Excerpt

Video Blogger Templates

5 Beautiful Dark Blogger Templates