BuddyBoss Home – Web Support Forums Plugins BuddyBoss Wall how many likes and how many comments

Viewing 4 posts - 1 through 4 (of 4 total)
  • Question

    #46538
    @payenda

    Hi,
    Currently I am using boss theme and social learner as child theme. I see in news feed and profile that wall plugin dose not show the number of likes and comments. I saw demo in your site and I see it shows how many comments and likes in buddyboss theme but in boss theme and social learner as child theme I see just icons and a sentence like show all comments but I do not see how many comments and how many likes.

    Answers

    #46606

    Anonymous
    @

    Hi @payenda, comment count is also not available inside the Boss demo
    You can add it
    copy entry.php from boss parent theme and paste it to same path inside the child theme and edit line 66

    buddypress/activity/entry.php line 66

    
    <a href="<?php bp_activity_comment_link(); ?>" class="fa fa-reply acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>">
    

    with

    
    <a href="<?php bp_activity_comment_link(); ?>" class="fa fa-reply acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf( __( '<span>%s</span>', 'buddypress' ), bp_activity_get_comment_count() ); ?></a>
    

    Regards
    Varun Dubey

    #46639
    @payenda

    Hi Varun,
    Thanks. Now I see comment count in my wall. Can you tell me please how to show likes count please? The above code just worked for comment count.
    Regards.

    #47005

    Anonymous
    @

    Hi @payenda, You can add the below code in the theme’s function.php :

    
    function get_users_fav_count($activity_id='')
    
    {
    if(empty($activity_id))
    {
    $activity_id = bp_get_activity_id();
    }
    
    global $wpdb;
    
    $query = "SELECT user_id FROM ".$wpdb->base_prefix."usermeta WHERE meta_key = 'bp_favorite_activities' AND meta_value LIKE '%:\"$activity_id\";%' ";
    
    $users = $wpdb->get_results($query,ARRAY_A);
    return count($users);
    }
    

    and span will be added in entry.php

    childtheme/buddypress/activity/entry.php

    
    <span><?php echo get_users_fav_count();?></span>
    

    Regards
    Pallavi

Viewing 4 posts - 1 through 4 (of 4 total)
  • The question ‘how many likes and how many comments’ is closed to new replies.