Check the codex docs for guides, this one is probably what you need to be working with, same loop as in groups/single/members.php:
https://codex.buddypress.org/developer/developer-docs/loops-reference/the-group-members-loop-bp_group_has_members/
@Hugo,
thank you so much!
But this loop displays all members of the entire network, right?
I only want to show only members of his group (hidden).
Thank you for your help!!!
Cheers
Marco
Sorry Hugo…
You are right! I have misunderstood the code. Thank you
Cheers Marco
@hugo
I´ve tried to do this. But I always get the result “This group has no members”:
First, I want to get the group_id of the group, which the member has joined.
<?php
global $bp;
$group = groups_get_group( array( ‘group_id’ => $group_id ) );
if ( bp_group_has_members( '$group' ) ) : ?>
<div id="member-count" class="pag-count">
<?php bp_group_member_pagination_count() ?>
</div>
<div id="member-pagination" class="pagination-links">
<?php bp_group_member_pagination() ?>
</div>
<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() ?>
<?php bp_group_member_link() ?>
<?php bp_group_member_joined_since() ?>
</li>
<?php endwhile; ?>
</ul>
<?php else: ?>
<div id="message" class="info">
<p>This group has no members.</p>
</div>
<?php endif;?>