Skip to:
Content
Pages
Categories
Search
Top
Bottom

Default to My Groups instead of All Groups in BP Default theme

  • Avatar of crazywhistlepig
    crazywhistlepig
    Participant

    @crazywhistlepig

    I am running a buddypress site consisting of hidden groups only. When a user clicks on the “Groups” tab in the main menu, it goes to the groups page which displays “No Groups found.” This confuses the members as they have to click the “My Groups” tab at the top to see their groups. Any way to default to the My Groups tab as active? Not as easy as it sounds as it is all driven by AJAX.

Viewing 1 replies (of 1 total)
  • Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    == I am running a buddypress site consisting of hidden groups only. ==

    @crazywhistlepig

    1st, remove the Groups tab from your custom menu. We will add the link to respective group per member.

    2nd, add this to your theme’s functions.php file
    `add_filter( ‘wp_nav_menu_items’, ‘mme_my_hidden_groups’ );
    function mme_my_hidden_groups($items) {
    if (!is_user_logged_in())
    return $items;
    else
    $hiddengroups = ‘

  • ‘ . __(‘My Groups’) . ‘
  • ‘;
    $items = $items . $hiddengroups;
    return $items;
    }`

    The “My Groups” link will appear at the end of the custom menu and will show up for logged in users only.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.