In this tutorial, I will explain how to remove activity tab from the user profile in BuddyPress. this is a simple and easy BuddyPress snippet which will remove the activity tabs from the user profile page.
Open the functions.php file and add the following snippet at the end of the file.
1 2 3 4 5 6 |
//Remove Activity tab from user profile page function bphelp_remove_activity_from_profile(){ bp_core_remove_nav_item('activity'); } add_action('bp_activity_setup_nav','bphelp_remove_activity_from_profile'); |
If you don’t want to edit your functions.php file, then create a new file as bp-custom.php inside the /wp-content/plugins/ folder and add the above code.
After adding the above code the Group tabs will be removed, see the below screenshot.
Use below code to rename the buddypress tab name.
1 2 3 |
$bp->members->nav->edit_nav( array( 'name' => 'Timeline', ), 'activity' ); |
1 |
bp_core_remove_nav_item( 'notifications', 'members' ); |
1 2 3 4 5 6 7 8 9 10 |
function rt_bp_groups_forum_first_tab() { global $bp; if( bp_is_group() ) { $bp->groups->nav->edit_nav( array( 'position' => 70 ), 'home', bp_current_item() ); } } add_action('bp_actions', 'rt_bp_groups_forum_first_tab'); |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: buddypress snippets, buddypress tutorial, buddypress tutorial 2018, buddypress tutorial beginners, buddypress tutorials, customize buddypress profile page, edit buddypress activity view, edit buddypress profile view