Yvan Nasr
Yvan Nasr

Reputation: 27

Remove the Activity Tab from the buddypress profile page

I am trying to remove the “Activity” tab from the navigation bar on the member profile page. I have been searching for a solution for days. While pasting the following code in child theme functions.php seems to work for other users, when I do so i am getting the following error:

Code i used:

     function bphelp_remove_groups_from_profile(){
     bp_core_remove_nav_item(‘activity’);
     }
     add_action(‘bp_activity_setup_nav’,’bphelp_remove_groups_from_profile’);

Error message:

” This is somewhat embarrassing, isn’t it? It seems we can’t find what you’re looking for. Perhaps searching can help.”

Link to the error page:

http://yvannasr.com/members/ron/

FYI – i have also tried pasting this into my bp-custom.php but its giving me the same error. Could anyone help me out with this please ?

Many thanks, Yvan

Upvotes: 1

Views: 1706

Answers (2)

Allen Wheeler
Allen Wheeler

Reputation: 26

Go to Settings -> BuddyPress in the admin dashboard and uncheck Activity Streams. This makes sure the activity page can't be accessed by entering it's URL in the address bar

Upvotes: 0

user5537573
user5537573

Reputation:

Use this code, I have tested it and it works.

/**
 * Removing the activity tab
 */
function mb_profile_menu_tabs(){

    global $bp;

    bp_core_remove_nav_item('activity');

}
add_action('bp_setup_nav', 'mb_profile_menu_tabs', 201);

Happy coding :-)

Upvotes: 2

Related Questions