Display list of the groups user is a member of

This simple snippet will display a list of the groups the current logged in user is a member of. This great little snippet you can add to a template or in fact add this to a menu or sidebar for easy access to the logged in users groups.

Code Snippet:

    $user_id = get_current_user_id();
    $args = array(
    'user_id' => $user_id
    if ( bp_has_groups( $args) ) :
    <?php while ( bp_groups() ) : bp_the_group(); ?>

        <div class="t-m-list">
          <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=full' ); ?><?php bp_group_name(); ?></a>

    <?php endwhile; ?>


  <?php endif; ?>

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!