This topic has 4 replies, 2 voices, and was last updated 9 years by Elismor.

  • Author

    Tagged: ,

  • #37997
     Elismor
    Participant

    Hi,
    I’d like to change the order of group tabs.
    As you can see in the attached file, the order now is:

    Home|Forum|Membri|Manda inviti|Media|Gestisci

    I’d like to have:
    Forum|Membri|Home|Manda inviti|Media|Gestisci

    and I’d also like to change the name “Home” with “Novità”.

    Is it possible?
    Thank you

    Attachments:
    You must be logged in to view attached files.
    #37999
     sharmstr
    Moderator

    http://shabushabu.eu/reordering-buddypress-group-tabs/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #38014
     Elismor
    Participant

    Hi Sharm, thank you.
    I tried pasting the code in functions.php but it didn’t function.

    COPY CODE
    function shabushabu_change_group_tag_position()
    {
        global $bp;
     
        if ( $bp->current_component == $bp->groups->slug )
        {
                $bp->bp_options_nav['groups']['home']['position'] = 20;
                $bp->bp_options_nav['groups']['home']['name'] = __( 'Activity', 'buddypress' );
     
                if (  $bp->current_action == 'home' )
                    $bp->current_action = 'forum';
        }
    }
    add_action( 'bp_init', 'shabushabu_change_group_tag_position' );
    #38139
     sharmstr
    Moderator

    Couple of problems

    1 – Normally home is position 10 and forum is position 20. In your code you are making home position 20, but not moving forum to position 10. That’s why you’re not seeing anything change, though technically, it has changed. Try this

    COPY CODE
    
    function custom_group_nav() 
    {
    
    global $bp;
    if (isset($bp->groups->current_group->slug) && $bp->groups->current_group->slug == $bp->current_item) 
      {
         $bp->bp_options_nav[$bp->groups->current_group->slug]['forum']['position'] = 10;
         $bp->bp_options_nav[$bp->groups->current_group->slug]['members']['position'] = 20;
         $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['position'] = 30;
         $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['name'] = __( 'Novità', 'buddypress' );
    }
    
    } 
    add_action( 'bp_init', 'custom_group_nav', 100000 );
    

    If you want to change the default tab to forum, you need to put this in your wp-config.php file.

    COPY CODE
    
    define( 'BP_GROUPS_DEFAULT_EXTENSION', 'forum' );	
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #38723
     Elismor
    Participant

    SHARMSTR! A big and enormous THANK YOU!!! ^_________________________^
    I’m really happy. I hope Santa Claus gives you everything you need.
    Have a nice day, a nice week, a nice year and life 😀
    smack!

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?