Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This is pretty much a very similar question to my previous one: Buddypress:bp_get_options_nav outside the Group?

I have the Group ID in my Post Meta, I also have the same slug. Each post has a single group associated with it (automatically created after a post has been made). I need to display the "Join this group" button in the post.

share|improve this question
add comment

1 Answer

Here $current_group_id is your group id which you have to get your post meta.

$current_group_id = $bp->groups->current_group->id;
$group = groups_get_group( array( 'group_id' => $current_group_id ) );     

            if( 'public' == $group->status ) {
                echo '<a id="group-' . esc_attr( $current_group_id ) . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>';
share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.