- InactiveLevel: EnlightenedPosts: 28
I want to get buddypress favorite count and mention count to display on my theme header how can I get this done
Hi Adeala,
You can get the total favourite count using this function$count = bp_activity_total_favorites_for_user( $user_id );
where you need to provide the $user_id for the context.
For example, to get total favourite count for logged in user, we can use
$count = bp_activity_total_favorites_for_user( get_current_user_id() );
If you are on a user profile and want to fetch the total count of the displayed user, you can do it like this
$count = bp_activity_total_favorites_for_user( bp_displayed_user_id() );
Hope that helps.
Regards
Brajesh
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
This topic is: not resolved