Sometimes its cool to display your blog’s statistics to your viewers and visitors if they are really good, so as to grab some attention. That can also attract some new followers to your blog. Below trick can help you with same, this trick will let you display your total number of comments on your blog. Hope you like it.
Note: Do take backup of your theme before you try this.
01. Just Add below code in your theme where you want to display your total number of comments:
<?php $numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'"); if (0 < $numcomms) $numcomms = number_format($numcomms); echo "There's ".$numcomms." total comments on my blog"; ?>
This concludes this simple and useful tutorial. Hope you like it.