Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re-order Subnav tabs in profile page


  • fatche
    Participant

    @fatche

    Hi everyone, I’m pretty much of a newbie in editing WP & BP core, but I know PHP.

    What I’m trying to do, is to reorder the subnav tabs in the user’s profile page.

    Right now, the order is : Personnal, Mentions, Favorites, Friends, Groups

    What i’d like is to switch Personnal and Groups positions AND when the user arrives in this page that the groups activity becomes the current selected tab.

    I’ve localized bp_get_options_nav() in bp-core-template but have no clue how to change this.

    Could anyone help me on this?

    Thanks in advance

    WP version : 3.4.2
    BP version : 1.6.1

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

  • fatche
    Participant

    @fatche

    Nobody to help me?


    Selu Vega
    Participant

    @bluelf

    I suggest the use of  Buddypress Extended Settings, a great plugin. https://wordpress.org/support/plugin/buddypress-extended-settings


    fatche
    Participant

    @fatche

    Thanks Selu Vega, but seems like there’s a problem on this plugging. Description, installation pages(…) don’t work, and downloading the plugging send me to a 404 error “File not found”.


    shanebp
    Moderator

    @shanebp

    I believe it has been bundled.
    Try here:
    http://shop.taptappress.com/downloads/category/plugin/


    bp-help
    Participant

    @bphelp

    @fatche@bluelf, @modemlooper removed this plugin from the repository unfortunetly! you could try creating a bp-custom.php file in yoursite/wp-content/plugins directory and add the following between opening and closing php tags:

    define(‘BP_DEFAULT_COMPONENT’,’groups’);
    global $bp;
    $bp->bp_nav[‘profile’][‘position’] = 20;
    $bp->bp_nav[‘forum’][‘position’] = 30;
    $bp->bp_nav[‘posts’][‘position’] = 40;
    $bp->bp_nav[‘activity’][‘position’] = 50;
    $bp->bp_nav[‘blogs’][‘position’] = 60;
    $bp->bp_nav[‘friends’][‘position’] = 70;
    $bp->bp_nav[‘messages’][‘position’] = 80;
    $bp->bp_nav[‘groups’][‘position’] = 10;
    $bp->bp_nav[‘settings’][‘position’] = 90;
    }
    add_action( ‘bp_init’, ‘tricks_change_bp_tag_position’, 999 );
    }
    add_action( ‘wp_head’, ‘tricks_change_bp_tag_position’,9 );

    The numbers in increments of ten correspond to the order in which they will be listed in the navigation.


    fatche
    Participant

    @fatche

    Many thanks to you @bphelp but there seems to be a problem with your fix, something is probably missing as there are 2 closing “}” and no openning “{“.

    And my problem is not with the Main Nav but the Sub one, here’s a schreenshot : Hebergeur d'image


    bp-help
    Participant

    @bphelp

    Untested but maybe this will work!
    `
    define(‘BP_DEFAULT_COMPONENT’,’groups’);
    global $bp;
    $bp->bp_nav[‘profile’][‘position’] = 20;
    $bp->bp_nav[‘forum’][‘position’] = 30;
    $bp->bp_nav[‘posts’][‘position’] = 40;
    $bp->bp_nav[‘activity’][‘position’] = 50;
    $bp->bp_nav[‘blogs’][‘position’] = 60;
    $bp->bp_nav[‘friends’][‘position’] = 70;
    $bp->bp_nav[‘messages’][‘position’] = 80;
    $bp->bp_nav[‘groups’][‘position’] = 10;
    $bp->bp_nav[‘settings’][‘position’] = 90;
    }
    add_action( ‘bp_init’, ‘tricks_change_bp_tag_position’, 999 );

    add_action( ‘wp_head’, ‘tricks_change_bp_tag_position’,9 );
    `


    fatche
    Participant

    @fatche

    Thanks again. I’ve figured out how to correct this, but my problem is still the same, I can’t find a way to re-arange the sub nav items as explained on the screenshot.


    fatche
    Participant

    @fatche

    I’ve actually found a way to re-arange the sub nav items in ‘wp-content\plugins\buddypress\bp-activity\bp-activity-loader.php’, between lines 141 to 197. Now I just have to find how to set the ‘Groups’ item in the sub nav as default on opening page.

    Seeing this from another perspective, I try to change the link on every page that redirect to the user’s profile to the user’s group’s activities like this :

    http://[my_url]/communaute/members/%5Bmember_id%5D/ (default link to user’s profile on evey page)

    to

    http://[my_url]/communaute/members/%5Bmember_id%5D/activity/groups/ (what I want as default).

    So the question is : how to edit the user’s profile url on top of every page


    bp-help
    Participant

    @bphelp

    define(‘BP_DEFAULT_COMPONENT’,’groups’);
    you put this in bp-custom.php and that should set it. example:
    define(‘BP_DEFAULT_COMPONENT’,’profile’);
    or
    define(‘BP_DEFAULT_COMPONENT’,’activity’);

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Re-order Subnav tabs in profile page’ is closed to new replies.
Skip to toolbar