If you have Activity enabled on your BuddyPress site, you will notice that Activity is the default landing page for user profiles. However, for many sites, it makes more sense to keep the public Profile page as the user landing page. It’s actually pretty simple to implement. We just need to reorder the tabs so Profile comes before Activity, and set Profile as the default tab.
If you don’t have one already, create a file in your plugins folder called bp-custom.php.
Reorder the tabs so Profile comes before Activity
Just add this code to bp-custom.php:
/* Reorder profile tabs */
function bbg_change_profile_tab_order() {
global $bp;$bp->bp_nav[‘profile’][‘position’] = 10;
$bp->bp_nav[‘activity’][‘position’] = 20;
}
add_action( ‘bp_setup_nav’, ‘bbg_change_profile_tab_order’, 999 );
You can add other nav items using this same format, and simply order them by increments of 10. Other options include:
$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;
Set Profile as the default tab
Just add this code to bp-custom.php
/* define the default Profile component */
define(“BP_DEFAULT_COMPONENT”,”profile”);// Now when you click on a user name link, You will land on User’s profile not user’s activity page
Helpful, to the point, and most importantly it just works. Thanks!
Hey Mike (or do you prefer Michael?)
Thanks so much for this tip! It works great. I did notice one small thing that’s happening now and I’m not sure if it’s unique to my site or if it happens elsewhere. When somebody has been “friended” you receive a notification within the admin bar at the top of the page. Upon clicking this it now takes you to the person’s profile, but it does not clear the notification. The only way the notification is cleared is if you visit the Friends section within your profile. Is there an easy fix for that?
As of 1.5 you don’t have to reorder the tabs.
Just define (BP_DEFAULT_COMPONENT, ‘profile’) in your functions.php
thanks alot ,really your help appreciated .
can any buddy say how to add sub nav tab in profile page next to change avatar link ?
Omdev, you can edit sidebar-home-left.php to add links here.
Great post admin!
Does this tip still work? I have tried to implement this in many ways, and it didn’t work for me.
First, I uploaded bp-custom.php with the code to my plugins page
Then, I tried creating a directory named folder (as in wp-plugins/folder); and then upload the bp-custom.php there. This didn’t work either.
Am I missing something?
Ayo, as Pitor pointed out simply add this to your theme functions.php file: define(BP_DEFAULT_COMPONENT, ‘profile’);
Excellent TJ! You have solved my problem.