Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] reordering profile tabs code not working


  • 5high
    Participant

    @5high

    Hi,

    background: new dev site with latest w/p and BP installed, and using the default BP-friendly Kleo theme by Themeforest.

    Q: recommended code for reordering profile tabs not working – is it correct or am I doing it wrong?

    I’ve scoured this forum and the i/net for options for this and think I’ve found the correct code, but it doesn’t have any effect! The code I’m using is this:

    define(‘BP_DEFAULT_COMPONENT’, ‘profile’ );
    function bbg_change_profile_tab_order() {
    global $bp;
    $bp->bp_nav[‘profile’][‘position’] = 10;
    $bp->bp_nav[‘media’][‘position’] = 20;
    $bp->bp_nav[‘groups’][‘position’] = 30;
    $bp->bp_nav[‘activity’][‘position’] = 40;
    $bp->bp_nav[‘notifications’][‘position’] = 50;
    $bp->bp_nav[‘messages’][‘position’] = 60;
    $bp->bp_nav[‘friends’][‘position’] = 70;
    $bp->bp_nav[‘settings’][‘position’] = 80;
    }
    add_action( ‘bp_setup_nav’, ‘bbg_change_profile_tab_order’, 999 );

    and I’ve tried it in my bp-custom.php and my child theme functions.php file – both no luck.

    Is this because it’s out of date? as i understand that BP has recently had a major makeover. Or have I just got it wrong or put it in the wrong file?

    All help or guidance much appreciated, as I’m now out of ideas! Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

  • rosyteddy
    Participant

    @rosyteddy

    In …./wp-content/plugins/bp-custom.php

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

    does re-order profile tabs – WP 4.1.1 Multisite and BP 2.2.1 – for me it works.

    Thanks


    5high
    Participant

    @5high

    Thanks so much for that @rosyteddy – it wasn’t until i compared your code with mine above (which is to all intents the same) that i realised that my “‘” around ‘profile’ and ‘position’ etc were the wrong ones! They were curly ones!

    I’d copied the code from an excellent blog (and checked it against others + the forum here) but hadn’t realisied the mistake – so now works perfectly!

    Hopefully I’ll now remember that for another time.

    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] reordering profile tabs code not working’ is closed to new replies.
Skip to toolbar