Skip to:
Content
Pages
Categories
Search
Top
Bottom

Profile as default subtab


  • wtravis
    Participant

    @wtravis

    Hi folks!

    I’m new to Buddypress, so my apologies for any noob-ish-ness on my part. Trying to troubleshoot a problem and seeking some guidance on what’s going wrong.

    I’m looking to make the Profile tab the default when opening up a member’s page, rather than their activity feed. I’d also like to make the Profile tab come before the Activity tab in the submenu list, but that’s as not crucial.

    Based on some other threads I found here, I’ve created a “bp-custom.php” file, stuck that in the root of the Buddypress plugin folder. Right now bp-custom.php looks like this:

    `
    bp_nav[‘profile’][‘position’] = 10;
    $bp->bp_nav[‘forum’][‘position’] = 30;
    $bp->bp_nav[‘posts’][‘position’] = 40;
    $bp->bp_nav[‘activity’][‘position’] = 20;
    $bp->bp_nav[‘blogs’][‘position’] = 60;
    $bp->bp_nav[‘friends’][‘position’] = 70;
    $bp->bp_nav[‘messages’][‘position’] = 80;
    $bp->bp_nav[‘groups’][‘position’] = 50;
    $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 );

    ?>
    `

    However that hasn’t accomplished either of the things I’m attempting to do. The Activity tab still appears when you go to a member’s page, and is listed before Profile in the submenu.

    I’m using Buddypress 1.6.4, and the default Buddypress theme (1.6.4), on WordPress 3.5.1.

    I have the following plugins installed and active:

    • BP Labs 1.3
    • BP User Profile Map 1.4.1
    • Breadcrumbs Everywhere 1.4
    • Contact Form 7 3.3.3
    • Really Simple Captcha 1.5
    • WP Custom Admin Bar 1.3.5

    If there’s a step I’ve missed, I’d really appreciate letting me know! Any help troubleshooting what the problems is would also be appreciated.

    Thanks!

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

  • bp-help
    Participant

    @bphelp

    @wtravis Add this instead to bp-custom.php
    `
    define(‘BP_DEFAULT_COMPONENT’,’profile’);
    function tricks_change_bp_tag_position() {
    global $bp;
    $bp->bp_nav[‘profile’][‘position’] = 10;
    $bp->bp_nav[‘activity’][‘position’] = 20;
    $bp->bp_nav[‘friends’][‘position’] = 40;
    $bp->bp_nav[‘messages’][‘position’] = 30;
    $bp->bp_nav[‘groups’][‘position’] = 50;
    $bp->bp_nav[‘forums’][‘position’] = 60;
    $bp->bp_nav[‘posts’][‘position’] = 70;
    $bp->bp_nav[‘blogs’][‘position’] = 80;
    $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 );
    `


    wtravis
    Participant

    @wtravis

    Hi bphelp,

    Sorry, the first few lines of my code apparently got cut off! I do actually have the define BP_DEFAULT_COMPONENT and tricks_change_bp_tag_position function in there. As far as I can tell I’m using exactly the same code that you’ve proposed. However, sadly, this hasn’t produced the effect I’m looking for.

    Is there something else I should be including in bp-custom.php (aside from the opening/closing PHP brackets), or do I need to place bp-custom.php somewhere else other than the root of the Buddypress plugin folder?


    wtravis
    Participant

    @wtravis

    Just for good measure I completely swapped out the code I had in bp-custom.php and replaced it with the code you’ve proposed and still no success. Thanks for the help, though!


    wtravis
    Participant

    @wtravis

    AHA! Found the problem. I thought I had to put bp-custom.php in the root of the BuddyPress plugin folder, but it should go in the WordPress plugins folder instead! Now it’s working!

    Somehow missed this tutorial on how to use bp-custom.php, was only guessing based on threads I’ve found here. https://codex.buddypress.org/developer/customizing/bp-custom-php/


    bp-help
    Participant

    @bphelp

    @wtravis no keep bp-custom.php in the plugins folder. its just a php file with no directory that sits in the plugin folder. If you created a folder in the plugins directory and put bp-custom.php in that folder then that is incorrect. I have the code working for me so I dunno why its not working for you.


    wtravis
    Participant

    @wtravis

    Figured it out at the same time as you solved it for me. Thanks again for your help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Profile as default subtab’ is closed to new replies.
Skip to toolbar