Skip to:
Content
Pages
Categories
Search
Top
Bottom

WP Groups


  • chrisknade
    Participant

    @chrisknade

    Hi

    Im trying to make a page that uses both the bp_group_has_members and bp_has_groups commands.

    Basically what I want to do is use the page title in the ( bp_has_groups( ‘type=single-group&slug=PageTitle’ ) ) : ?> which is fine (written that way just to clarity) but then I want to use the same for the <?php if ( bp_group_has_members(‘group_id=2&per_page=8’) ) : ?> part of my code.

    Just wondering if theres a way that I can say “output the id of the group that equals to the slug PageTitle” so that i can use it in the bp_group_has_members function

    Hope someone can help as I’m finding this abit of a headache.

    Im using, WPMU 2.71 and Buddypress 1.01

Viewing 1 replies (of 1 total)

  • chrisknade
    Participant

    @chrisknade

    Right to clarify abit more this is what I have so far.

    <?php echo the_title(); ?>
    <?php if ( bp_has_groups( 'type=single-group&slug=USA' ) ) : ?>

    <div class="pagination-links" id="group-count">
    <?php bp_group_pagination_count() ?>
    </div>

    <div class="pagination-links" id="group-pag">
    <?php bp_group_pagination() ?>
    </div>

    <ul id="group-list">
    <?php while ( bp_groups() ) : bp_the_group(); ?>
    <li>
    <!-- Example template tags you can use -->
    <?php bp_group_avatar_thumb() ?>
    <?php $group_Id_Featured = bp_group_id() ?>
    <?php bp_group_permalink() ?>
    <?php bp_group_name() ?>
    <?php bp_group_total_members() ?>
    <?php bp_group_description_excerpt() ?>
    </li>
    <?php endwhile; ?>
    </ul>

    <?php else: ?>

    <div id="message" class="info">
    <p>There are no groups to display.</p>
    </div>

    <?php endif; ?>

    <?php if ( bp_group_has_members('group_id=2&per_page=8') ) : ?>

    <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;?>

    As you can see I’ve got <?php $group_Id_Featured = bp_group_id() ?> in there.

    Im trying to say if

    <?php if ( bp_group_has_members(‘group_id=2&per_page=8’) ) : ?> and use group_id=$group_Id_Featured . Anyone have any idea for the syntax for that. Tried loads of different variations none of which work.

Viewing 1 replies (of 1 total)
  • The topic ‘WP Groups’ is closed to new replies.
Skip to toolbar