BuddyBoss Home – Web › Support Forums › Plugins › BuddyBoss Wall › how many likes and how many comments
- This topic has 3 replies, 3 contibutors, and was last updated 9 years, 1 months ago by Anonymous.
Question
September 17, 2015 at 2:20 pm #46538@payendaHi,
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
September 18, 2015 at 11:55 am #46606@
AnonymousHi @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 66buddypress/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 DubeySeptember 18, 2015 at 11:56 pm #46639@payendaHi 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.September 24, 2015 at 7:15 am #47005@
AnonymousHi @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
- The question ‘how many likes and how many comments’ is closed to new replies.