
Show Group Member List on Group Directory
By: a guest on
Jan 10th, 2013 | syntax:
PHP | size: 1.89 KB | hits: 31 | expires: Never
<ul id="groups-list" class="item-list" role="main">
<?php while ( bp_groups() ) : bp_the_group(); ?>
<li>
<div class="item-avatar">
<a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=full&width=80&height=80' ); ?></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>
<?php do_action( 'bp_directory_groups_item' ); ?>
<?php if ( bp_group_has_members( 'group_id=&exclude_admins_mods=false' ) ) : ?>
<ul id="member-list" class="item-list">
<?php while ( bp_group_members() ) : bp_group_the_member(); ?>
<li>
<!-- Example template tags you can use -->
<?php bp_group_member_avatar_thumb() ?>
<?php bp_group_member_link() ?>
<?php do_action( 'bp_directory_members_item' ); ?>
<?php
/***
* If you want to show specific profile fields here you can,
* but it'll add an extra query for each member in the loop
* (only one regardless of the number of fields you show):
*
* bp_member_profile_data( 'field=the field name' );
*/
bp_member_profile_data( 'field=Biography' );
?>
</li>
<?php endwhile; ?>
</ul>
<?php else: ?>
<div id="message" class="info">
<p>This group has no members.</p>
</div>
<?php endif;?>
</div>
<div class="action">
<?php do_action( 'bp_directory_groups_actions' ); ?>
<div class="meta">
<?php bp_group_type(); ?> / <?php bp_group_member_count(); ?>
</div>
</div>
<div class="clear"></div>
</li>
<?php endwhile; ?>
</ul>