How-to

Customize profiles and group menus in BuddyPress

This is a short article about how to customize profiles and groups in BuddyPress.

It took me a while to find all the answers, that’s why I bring them all together here, so you do not need to search again.

Starting with the customize profiles

1. Change the menu order in the profile

If you like to change the menu order in your profile pages, you will need to create a bp-custom.php in your plugin directory. Just create the new file inside the folder wp-content/plugins.

Add the following function to the bp-custom.php:

pre type="php"
function bbg_change_profile_tab_order() {
global $bp;

$bp->bp_nav[‘profile’][‘position’] = 10;
$bp->bp_nav[‘activity’][‘position’] = 20;
$bp->bp_nav[‘friends’][‘position’] = 30;
$bp->bp_nav[‘groups’][‘position’] = 40;
$bp->bp_nav[‘blogs’][‘position’] = 50;
$bp->bp_nav[‘messages’][‘position’] = 60;
$bp->bp_nav[‘settings’][‘position’] = 70;
}
add_action( ‘bp_setup_nav’, ‘bbg_change_profile_tab_order’, 999 );
/pre

The number is for the position of the menu. If you have plugins installed, who add their own menu item into your profile nav, use the slug of the component to manipulate the position.

For example if you have events or a gallery nav item, it would be something like this:

pre type="php"

$bp->bp_nav[‘events’][‘position’] = 40;
$bp->bp_nav[‘gallery’][‘position’] = 50;

/pre

2. Rename a menu item

Add the following line to the function and change the activity to what ever you want to rename:

pre type="php"

$bp->bp_nav[‘activity’][‘name’] = ‘wall’;

/pre

3. Remove a menu item

If you want to remove a nav item, add this line to the function and change activity to whatever you want to remove:

pre type="php"

$bp->bp_nav[‘activity’] = false;

/pre

Have a look at the forum post where I got the most info from:

http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/customizing-buddypress-profile-page-default-tab-and-item-nav-order/

Now we go to the groups

1. Change the menu order in groups

If you like to change the menu order in your profile pages, you will need to create a bp-custom.php in your plugin directory. If you already have a bp-custom.php, just add the function at the end before the “?>”

pre type="php"
function my_bp_groups_forum_first_tab() {
global $bp;

$bp->bp_options_nav[‘groups’][‘home’][‘position’] = ’50’;
}
add_action(‘wp’, ‘my_bp_groups_forum_first_tab’);
/pre

http://pastebin.com/eTNKwgCR

This function works exactly the same way, like the profile function works. The number is the position.
In this function we just move the home item. Adding more lines like in the profile function above depends on what nav items you have in your group.

2. Set the forum nav item as the default nav item in groups

To make the forum your home tab of the group, paste the following in /wp-content/plugins/bp-custom.php:

pre type="php"
function redirect_to_forum() {
global $bp;

$path = clean_url( $_SERVER[‘REQUEST_URI’] );

$path = apply_filters( ‘bp_uri’, $path );

if ( bp_is_group_home() && strpos( $path, $bp->bp_options_nav[‘groups’][‘home’][‘slug’] ) === false )
bp_core_redirect( $path . $bp->bp_options_nav[‘groups’][‘forum’][‘slug’] . ‘/’ );
}
add_action( ‘wp’, ‘redirect_to_forum’ );
/pre

http://pastebin.com/j3n17CVe (you’ll probably need to tweak the code for BP subdomain installs!)

3. Rename a nav item

If you want to rename a nav item, copy this line to the my_bp_groups_forum_first_tab function. This example will change “Home” to “Something”.

pre type="php"

$bp->bp_options_nav[‘groups’][‘home’][‘name’] = ‘Something’;

/pre

4. Remove a nav item

Add this line to the my_bp_groups_forum_first_tab function to remove the home item. Change the home to your needs:

pre type="php"

$bp->bp_options_nav[‘groups’][‘home’] = false;

/pre

Have a look at the forum post where I got the most info from:

http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/changing-group-tab-display-defaults/#post-55449

More from the Blog

View all posts

BuddyForms Form Builder

News

BuddyForms Form Builder

News

2 min read

New BuddyForms version with complete improved UI and tons of new features is coming soon!

Web Development

Web Development

8 min read

Webflow vs WordPress: Which One Should You Choose in 2025?

News

WooCommerce BuddyPress

News

WooCommerce BuddyPress

1 min read

WooCommerce BuddyPress Integration 1.2.1

Web Design

Web Design

7 min read

What Is Figma? A Beginner’s Guide to the Popular Design Tool

News

Special Deals

News

Special Deals

1 min read

We Move to La Gomera

How-to

How-to

6 min read

Top 10 Amazing Web Designing Tips To Ensure Maximum Conversion

Web Development

Web Development

11 min read

Thinking Beyond Themes? Here’s What Custom WordPress Development Really Means

Uncategorized

Uncategorized

4 min read

What is Web hosting?

Create Content

How-to

Useful Tools

Create Content

How-to

4 min read

Ultimate Member Benefits

Content Marketing

Create Content

Marketing

Content Marketing

Create Content

7 min read

6 Content & Social Media Trends for Marketing Success in 2021

Start your next project with us

Whether it's design or development, we're the perfect partner for fast, flexible, forward-thinking projects. Reach out & let's get the conversation started.
Get Started