Skip to:
Content
Pages
Categories
Search
Top
Bottom

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


  • 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)

  • @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 = '<li><a href="' . bp_loggedin_user_domain('/') . 'groups' . '">' . __('My Groups') . '</a></li>';
    $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)
  • The topic ‘Default to My Groups instead of All Groups in BP Default theme’ is closed to new replies.
Skip to toolbar