How to display total number of comments on WordPress blog

Place below code in your WordPress template where you want to display the total number of comments on WordPress blog.

 
 
<?php
	$total_comments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
	if (0 < $total_comments) $total_comments = number_format($total_comments);
?>

Related posts:

HTML5 page structure

HTML5 offers more powerful structure comparing to older versions of Html. There are many new …


Partner with Us

We are providing an exclusive partnership offer to individuals and companies who are interested in setting up their own web design & development company. For more information about how to partner with us, please contact us