Skip to:
Content
Pages
Categories
Search
Top
Bottom

Profile – Sorry!

  • @lloan

    Participant

    First off – Sorry!

    I know this question is asked a lot – but I’ve searched around the forum and I get very ambiguous answers.

    How do I reorder the profile menu (activity, profile, etc).

    Does this work if I put it in my themes functions.php or bp-custom.php ? ->

    function bbg_change_profile_tab_order() {
    global $bp;
    
    $bp->bp_nav['profile']['position'] = 60;
    $bp->bp_nav['activity']['position'] = 50;
    $bp->bp_nav['friends']['position'] = 40;
    $bp->bp_nav['groups']['position'] = 30;
    $bp->bp_nav['settings']['position'] = 10;
    $bp->bp_nav['forum']['position'] = 20;
    }
    add_action(‘bp_setup_nav’, ‘bbg_change_profile_tab_order’, 999 );
    ?>

    I’ve seen other solutions, but they’re for older versions of buddypress – forum looking buddypress, lol.

    If someone could point me in the right direction?

    Ideally, I’d like to find the buddypress 1.93 codex – but unless I’m blind – I keep finding outdated stuff. Alternatively, someone pointing me to the write files to edit would also be great.

    Thanks guys!

Viewing 5 replies - 1 through 5 (of 5 total)
  • @johnjamesjacoby

    Keymaster

    Something like that should work! I cleaned it up a little for you, and fixed a typo.

    function bbg_change_profile_tab_order() {
    	$bp = buddypress();
    	$bp->bp_nav['profile']['position']  = 60;
    	$bp->bp_nav['activity']['position'] = 50;
    	$bp->bp_nav['friends']['position']  = 40;
    	$bp->bp_nav['groups']['position']   = 30;
    	$bp->bp_nav['settings']['position'] = 10;
    	$bp->bp_nav['forums']['position']   = 20;
    }
    add_action( 'bp_setup_nav', 'bbg_change_profile_tab_order', 999 );

    @lloan

    Participant

    Thanks for the reply John ^-^! I think that 2nd line totally did the job, lol.
    I tried putting it in /wp-content/plugins/buddypress/bp-custom.php and it didn’t work.
    I tried putting it in my theme’s function.php and it worked there.

    Do you think it would be upgrade proof if I put it in bp-custom.php instead? If so, do you think I put it in the wrong location ._. – I tend to be a total klutz.

    @johnjamesjacoby

    Keymaster

    To be completely upgrade proof, I would make an mu-plugin out of it.

    https://codex.wordpress.org/Must_Use_Plugins

    That way it’s always running when BuddyPress is running, and it will never go away unless you explicitly tell it to by deleting or modifying your code.

    Look! You’re writing your own plugins today!

    @lloan

    Participant

    Lol! Awesome – Thanks John ^-^!

    I was able to change the order and set the default to another page instead of activity. Thanks for pointing me in the right direction ^-^.

    I’ll check that out -> mu-plugin

    Now for a bigger endeavor -> Making everything show up on same page ._.

    @revadigital

    Participant

    First off, thanks John for the above code. I was struggling to find the latest myself. I was able to rearrange my tabs, but I need to know how to set the Profile tab as the default ONLY for users viewing other user’s profiles. This is because the user should see their own “My Home” dashboard when they click their own name, and see the “Profile” when they click another user’s name. I tried this code below but it changes the default in both cases –

    define( ‘BP_DEFAULT_COMPONENT’, ‘profile’ );

    Any ideas?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Profile – Sorry!’ is closed to new replies.
Skip to toolbar