WordPress.org

Forums

Total number of comments of the all posts in one category (3 posts)

  1. csseur3
    Member
    Posted 6 years ago #

    Hello,

    in a loop, i want to show the total number of comments of the posts of the one specific category, how to do that?

    i just know the <?php comments_popup_link() ?> to show the total number of comments of a one post.

    bye

  2. csseur3
    Member
    Posted 6 years ago #

    Re,

    i have this:

    function mdv_comment_count() {
    
        global $wpdb;
    
    	$request = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'";
    
        echo $wpdb->get_var($request);
    
    }

    but the function is the total number of comments in all category.. hum, little help please =p

  3. csseur3
    Member
    Posted 6 years ago #

    up =p

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.