This topic has 2 replies, 2 voices, and was last updated 9 years by carolina marques.

  • Author
  • #64805
     carolina marques
    Participant

    Is there some code I can use to make the visible side menu only for logged in users?

    #64806
     sharmstr
    Moderator

    Hmmmm. Try this in your child’s functions.php file

    COPY CODE
    
    add_action( 'init', 'remove_side_menu', 10 );
    function remove_side_menu() {
        if ( !is_user_logged_in() ) {
            remove_filter('wp_nav_menu_items', 'kleo_side_menu_button', 20, 2);
            remove_filter('body_class', 'kleo_offcanvas_classes');
            remove_action('kleo_after_page', 'kleo_show_side_menu');
        
        }
    }
    
    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

    #64827
     carolina marques
    Participant

    Perfect thank you.

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

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

Log in with your credentials

Forgot your details?