July 22, 2010

TEXT SIZE minus plus

Display the Total Number of Comments on Your WordPress Blog

Advertisement
You Might Be Interested In Our Popular Article
  • Most Essential Free Softwares After Windows Installation
  • Ever wondered on how to show total number of comments posted on your blog without manually updating the count. This simple hack will help you display total number of comments on your WordPress blog. Hope you find it useful.

    comment count code

    One Step Tutorial:

    Place below code where you want to display your comment count:

    <?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";
    ?>

    That’s it.



    Related Posts From Network
    Print

    About the Author

    When I was born I was so shocked I didn't speak for a year and half...... My brain has 2 parts, Right and Left, The Right one has nothing left in it and the Left one has nothing right in it......Who says Nothing is Impossible?? I've been doing nothing for years......

    View Comments to “Display the Total Number of Comments on Your WordPress Blog”

    Author comments are in a darker gray color for you to easily identify the posts author in the comments

    1. Been looking for this article for long time ago and finally found here. thanks for sharing this post. appreciate!

    Comments are closed.

    blog comments powered by Disqus