This topic has 7 replies, 3 voices, and was last updated 9 years by sharmstr.

  • Author

    Tagged: 

  • #47988
     klosurdo
    Participant

    Is there a plugin, or an easy way to hide menu items for non logged in visitors? I want to have only the “media” menu and possibly the documents icons viewable to non logged in visitors. I would like all icons viewable to only those members that are logged in.

    I am hoping there is a plugin that can do that.

    #47993
     sharmstr
    Moderator

    If you cant find a pluing (I couldnt) then you’ll have to custom code something. More than likely you’ll have to use bp_core_remove_nav_item() and ! is_user_logged_in().

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48146
     Rincon805
    Participant

    I found IfMenu (https://wordpress.org/plugins/if-menu/) but upon activation it displays that there’s another plugin that manages menu items so it disables Ifmenu.

    I’d be curious to hear what other plugins affect the menu option to make the decision on whether or not we need them. Custom menu visibility would be amazing.

    #48156
     sharmstr
    Moderator

    Sorry, editing because I got my topics screwed up.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48158
     sharmstr
    Moderator

    Actually, I was right. He is talking about the profile tabs. Not the WP menu. Geeez, I need a nap.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48159
     klosurdo
    Participant

    Thanks,

    I actually found the following code that did exactly what I wanted to do.

    COPY CODE
    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( 'profile' );
    		bp_core_remove_nav_item( 'friends' );
    		bp_core_remove_nav_item( 'groups' );
    		bp_core_remove_nav_item( 'forums' );	
    
    //bp subnav (my activities, my groups, etc)
    	//  bp_core_remove_subnav_item( 'activity', 'activity' );
    		bp_core_remove_subnav_item( 'activity', 'friends' ); 
    		bp_core_remove_subnav_item( 'activity', 'favorites' );
    		bp_core_remove_subnav_item( 'activity', 'groups' );
    		bp_core_remove_subnav_item( 'activity', 'mentions' );
    	}
    }
    add_action( 'bp_ready', 'bpfr_hide_top_nav', 10 );

    Added it to my child-theme functions.php

    #48160
     sharmstr
    Moderator

    @rincon805 Several of us use https://wordpress.org/plugins/menu-items-visibility-control/ for wp menu item visibility

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #48161
     sharmstr
    Moderator

    LOL. See… a combination of bp_core_remove_nav_item and !is_user_logged_in. Good job!

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?