Skip to:

Display follower and following count

  • thirstcard


    Hi guys

    I am using the following to get the total number of friends a logged in user has.

    friends_get_total_friend_count( $user_id = bp_loggedin_user_id()

    How could I get the total number of followers a logged in user has?

    Also, I’d like to be able to display the total number of people a logged in user is following.

Viewing 6 replies - 1 through 6 (of 6 total)
  • That should be in the plugin somewhere?

    It displays this in a profile account doesn’t it?

    Followers: [2] Following: [2]




    It does. I’m not currently using the default menu so don’t get the Followers [2] Following [2]. I have come up with this to get the following count

    Now just working on the ‘followers’ count. Any pointers will be great! :}



    OK here’s my attempt which works for me:

    If there is an easier way (or a way which is better practice) then let me know :}

    bp_follow_total_follow_counts() is the function I used

    I used it in a function fed to a do_action in the members-header to produce that stat view above, you’re probably better off running this stuff in functions.php then you can feed it here there and everywhere you may need it.

    As for best practise, there are various means of grabbing data, there seem to be plenty of template functions one could use so that approach is possibly not the best, but if it works…



    Thanks @Hugo

    functions.php is a good idea… i’ll do that so it can be reused throughout the theme.

    Mehul Kaklotar


    Great. Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display follower and following count’ is closed to new replies.
Skip to toolbar