BuddyDev

Search

Buddypress User Badges in Activity Feed

  • Participant
    Level: Initiated
    Posts: 3
    Ted Barnett on #34158

    We would like to show the Buddypress User Badges in the Activity feed after a person’s name. Is there a filter or other hook we can use to do this?

  • Keymaster
    (BuddyDev Team)
    Posts: 24433
    Brajesh Singh on #34165

    Hi Ted,
    Thank you for the question.

    Yes, there are ways to achieve it. would you like to show one or all badges of the user?

    Also, which theme and template pack are you using?

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 3
    Ted Barnett on #34167

    Right now we only have one badge setup for our Administrator Role so community members know they are talking to someone on the support team. So for now we only need one badge but wouldn’t hurt to maybe show all in the future.

    We are using the Kleo WordPress Theme and the Buddypress Legacy template pack

  • Keymaster
    (BuddyDev Team)
    Posts: 24433
    Brajesh Singh on #34175

    Thank you Ted.
    Please allow me to check and get back to you by tomorrow.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 3
    Ted Barnett on #34176

    Perfect thank you!

  • Keymaster
    (BuddyDev Team)
    Posts: 24433
    Brajesh Singh on #34186

    Hi Ted,
    Thank you for the patience.

    I had a look at the kleo theme and BuddyPress in general.

    The display name in activity is not built dynamically and there are no hooks available there.

    We can use this code to display the badges of activity author

    
    <?php if ( function_exists( bp_user_badges_get_user_badges_html ) ) {
    	echo bp_user_badges_get_user_badges_html( bp_get_activity_user_id() );
    }
    

    But it needs to be put somewhere in the kleo/buddypress/activity/entry.php (You can copy this file to child theme) and put the code.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved