Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to show comment count blog post in profile buddypress


  • grosso2020
    Participant

    @grosso2020

    Hello!
    I want to output a user comment counter to wordpress posts.
    I use this code

    
    <?php
    $user_id = bp_displayed_user_id();
    $args = array('user_id', 'count' => true);
    $comments = get_comments($args);
    echo $comments
    ?>
    

    But he deduces for some reason the total number of comments to all posts
    How do I display the number of user comments?
    Thanks!

Viewing 1 replies (of 1 total)

  • Prashant Singh
    Participant

    @prashantvatsh

    $user_id = bp_displayed_user_id();
    $args = array('user_id'=>$user_id, 'count' => true);
    $comments = get_comments($args);
    print_r($comnents);

    Please check with this code.

    Hopefully this will work for you.

    Thanks

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar