Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove 'Activity' item and content from profile page


  • leanneoleary
    Participant

    @leanneoleary

    I am trying to remove the “Activity” tab and content from the profile page. If I use the CSS li#activity-personal-li {display:none} I can remove the tab but the activity content still shows when you first go to the profile page.

    I have tried using the following code after reading the forums and help guildes but this only removes the tab name and not the whole HTML for the tab or the content.

    //remove activity tab from profile page
    function bbg_remove_activity_tab() {
        global $bp;
    
        $bp->bp_nav['activity'] = false;
    }
    add_action( 'bp_setup_nav', 'bbg_remove_activity_tab', 999 );

    can someone please help?

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

  • danbp
    Moderator

    @danbp

    Profile default tab is member’s activity. You have to modify this first and assign another tab to default. For example, profile tab.

    define('BP_DEFAULT_COMPONENT', 'profile' );

    Now you can use this to remove the activity tab. Note that the second if is related to visitor, you can remove it if you never want to show the activity tab.

    function bpfr_hide_top_nav() {	
    if( bp_is_active('xprofile' ) )	
    	if( !is_user_logged_in() ) {			
    		bp_core_remove_nav_item( 'activity' );
    	}
    }
    add_action( 'bp_ready', 'bpfr_hide_top_nav' );

    leanneoleary
    Participant

    @leanneoleary

    That worked a treat, thank you! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove 'Activity' item and content from profile page’ is closed to new replies.
Skip to toolbar