Posted By

laurentzziu on 11/15/10


Tagged

number wordpress comments total


Versions (?)

Wordpress Total Number of Comments


 / Published in: PHP
 

  1. <?php $numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'"); if (0 < $numcomms) $numcomms = number_format($numcomms); ?>
  2.  
  3. <?php echo "There's ".$numcomms." total comments on my blog"; ?>

Report this snippet  

You need to login to post a comment.