Skip to content

Instantly share code, notes, and snippets.

@shanebp
Created September 24, 2014 17:01
Show Gist options
  • Save shanebp/dd7186f4997ee3c48785 to your computer and use it in GitHub Desktop.
Save shanebp/dd7186f4997ee3c48785 to your computer and use it in GitHub Desktop.
buddypress - list the groupsthat someone else has created but I have joined
<?php if ( bp_has_groups( 'type=alphabetical&user_id=' . bp_loggedin_user_id() ) ) : ?>
<ul>
<?php while ( bp_groups() ) : bp_the_group(); ?>
<?php if( bp_get_group_creator_id() != bp_loggedin_user_id() ) : ?>
<li>
<div>
<a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar_thumb() ?></a>
</div>
<div>
<div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div>
</div>
</li>
<?php endif; ?>
<?php endwhile; ?>
</ul>
<?php else: ?>
<div class="error">No current groups.</div>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment