This topic has 5 replies, 2 voices, and was last updated 9 years by matt88.

  • Author

    Tagged: 

  • #80401
     matt88
    Participant

    By searching the forums I found this and similar code to reorder the buddypress tabs

    COPY CODE
    function my_change_profile_tab_order() {
        global $bp;
        $bp->bp_nav['settings']['position'] = 10;
        $bp->bp_nav['activity']['position'] = 20;
        $bp->bp_nav['friends']['position'] = 30;
        $bp->bp_nav['groups']['position'] = 40;
        $bp->bp_nav['blogs']['position'] = 50;
        $bp->bp_nav['messages']['position'] = 60;
        $bp->bp_nav['profile']['position'] = 70;
    }
    add_action( 'bp_setup_nav', 'my_change_profile_tab_order', 999 );

    But how would you reorder the Buddypress Group tabs

    #80402
     matt88
    Participant

    After using different search terms I found this https://archived.seventhqueen.com/forums/topic/group-tabs-how-to-change-the-order Can I use both methods one for profile tabs and group tabs in the same file. I think it is functions.php, which code would go first?

    #80403
     sharmstr
    Moderator

    Yes. Doesnt matter which is first.

    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

    #80417
     matt88
    Participant

    Thanks sharmstr

    I have the following code

    COPY CODE
    add_action('bp_init','change_media_tab_position', 12);
    function change_media_tab_position(){
        global $bp;
        if( isset ($bp->bp_nav['media'])){
            $bp->bp_nav['media']['position'] = 30;
        }
    }
    
    function my_change_profile_tab_order(){
        global $bp;
        $bp->bp_nav['activity']['position'] = 10;
        $bp->bp_nav['profile']['position'] = 20;
        $bp->bp_nav['my articles']['position'] = 40;
        $bp->bp_nav['forums']['position'] = 50;
        $bp->bp_nav['groups']['position'] = 60;
        $bp->bp_nav['events']['position'] = 70;
        $bp->bp_nav['friends']['position'] = 80;
        $bp->bp_nav['send invites']['position'] = 90;
        $bp->bp_nav['notifications']['position'] = 100;
        $bp->bp_nav['messages']['position'] = 110;
        $bp->bp_nav['settings']['position'] = 120;
    }
    add_action( 'bp_setup_nav', 'my_change_profile_tab_order', 999 );
    

    But not all the tabs are lining up to the order plus it added some blank tabs see screenshot

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

    Because it needs the names of the slug. ‘my articles’ isnt the slug. ‘articles’ is. ‘send invites’ is probably wrong too, so is events. click on the link and look at the url to find the slug. Because you didnt use the correct slugs, 3 phantom tabs were created and 3 werent moved.

    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

    #80425
     matt88
    Participant

    Oh I see, Now Friends, Events, and Send Invites are out of order could be a plugin issue like rtmedia was. I’ll do the groups now

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

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

Log in with your credentials

Forgot your details?