Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove member activity stream from profile nav bar

  • @klosurdo

    Participant

    Hi,

    I want to remove the activity stream from my profile nav bar, but only to the non member public. I have tried the following unsuccessfully, however it removed all the other icons no problem.

    Thanks

    Ken

    function bpfr_hide_top_nav() {

    if( !is_user_logged_in() ) {

    // bp topnav items to hide
    // bp_core_remove_nav_item( ‘activity’ );
    bp_core_remove_nav_item( ‘friends’ );
    bp_core_remove_nav_item( ‘groups’ );
    bp_core_remove_nav_item( ‘forums’ );
    bp_core_remove_nav_item( ‘following’ );
    bp_core_remove_nav_item( ‘followers’ );

    The Theme I am using is KLEO by Seventh Queen
    Buddy Press version Version 2.2.1
    Website:http://www.cmpg-annex.org/

    Other Plugins
    Akismet
    bbPress
    BuddyPress Cover Photo
    K Elements
    MOJO Marketplace
    Paid Memberships Pro
    PMPro MailChimp Integration
    PMPro Register Helper
    PMPro Set Expiration Dates
    Register Helper Example
    Revolution Slider
    rtMedia Pro for WordPress, BuddyPress and bbPress
    The Events Calendar
    WPBakery Visual Composer

Viewing 3 replies - 1 through 3 (of 3 total)
  • @shanebp

    Moderator

    ‘Activity’ is the default tab.
    If you want to remove it, you need to change the default tab.

    Change Default Members Profile Landing Tab

    define('BP_DEFAULT_COMPONENT', 'profile' );
    
    function klosurdo_remove_member_nav($nav_array) { 
    	
    	if( !is_user_logged_in() ) 
    		$nav_array = '';
    		
    	return $nav_array;
    }
    add_filter('bp_get_displayed_user_nav_activity', 'klosurdo_remove_member_nav', 15, 1 );

    @klosurdo

    Participant

    Will this work for all members or just klosurdo? I would like it to be for all members.

    @danbp

    Participant

    For all non logged in users.

    – klosurdo is the function name.
    – if is the statement
    – is_user_logged_in is the condition
    – ! means “not” in php

    http://www.w3schools.com/php/default.asp

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove member activity stream from profile nav bar’ is closed to new replies.
Skip to toolbar