Skip to content

Instantly share code, notes, and snippets.

@BoweFrankema
Created August 4, 2014 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BoweFrankema/650ff1e530f0d3f30508 to your computer and use it in GitHub Desktop.
Save BoweFrankema/650ff1e530f0d3f30508 to your computer and use it in GitHub Desktop.
BuddyPress Groups Loop with specific groups based on ID
<?php
$args = array(
'include' => "4,5,2",
'max' => 5
);
if ( bp_has_groups( $args) ) :
?>
<ul id="groups-list" class="item-list">
<?php while ( bp_groups() ) : bp_the_group(); ?>
<li>
<div class="item-avatar">
<a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ) ?></a>
</div>
<div class="item">
<div class="item-title"><a href="<?php bp_group_permalink() ?>"><?php bp_group_name() ?></a></div>
<div class="item-desc"><?php bp_group_description_excerpt() ?></div>
</div>
<div class="clear"></div>
</li>
<?php endwhile; ?>
</ul>
<?php else: ?>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment