Skip to:
Content
Pages
Categories
Search
Top
Bottom

Members directory for hidden groups

  • @marmuel

    Participant

    Hi,

    I want to show only members of the hidden group and not all of the members registered in buddypress.
    For this, I would create a custom member directory.
    By buddypress default: If I go to Groups and select the Group, select Members, I get a member-list of the hidden group.

    How can I put this list in new site?

    Thank you very much
    Cheers
    Marco

Viewing 5 replies - 1 through 5 (of 5 total)
  • @hnla

    Participant

    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/

    @marmuel

    Participant

    @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

    @hnla

    Participant

    But this loop displays all members of the entire network, right?

    Did you read the page?

    @marmuel

    Participant

    Sorry Hugo…
    You are right! I have misunderstood the code. Thank you
    Cheers Marco

    @marmuel

    Participant

    @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;?>
    
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Members directory for hidden groups’ is closed to new replies.
Skip to toolbar