hi,
try this
friends_get_friend_count_for_user( $user_id );
Or this if you call it in a member page :
friends_get_total_friend_count()
Hi @okuleyeflo,
give this a try. Use it in bp-custom.php or functions.php of your theme.
Tested on BP 1.8.1 with bp-default theme
function bpfr_my_total_friends() {
if ( is_user_logged_in() ) :
if ( bp_is_active( 'friends' ) ) :
echo '<br/><br/>My Total Friends: '. bp_get_total_friend_count( $user_id ) .'';
endif;
endif;
}
add_filter ( 'bp_sidebar_me', 'bpfr_my_total_friends');
Open bp-default/sidebar.php to see on witch placeholder (do_action…) of the sidebar you want to use the function.
The above example use bp_sidebar_me who shows the counter underneath the login/logout button
Thanks @megainfo, for your input,
@danbp, thank you so much, that did the trick
Regards
@okuleyeflo,
I just released a widget plugin which shows photos and names of user’s friends or current viewing member’s friends and it shows total friends count aswell a link to view all. something similar to Facebook. you can have a look if it may be useful.
https://wordpress.org/plugins/bp-facebook-style-friend-lists/screenshots/
Naijaping