This topic has 2 replies, 2 voices, and was last updated 8 years by Vanessa.

  • Author
  • #94498
     Vanessa
    Participant

    Hi there,

    I’d like to hide the entire top menu bar (including social icons) when a user is logged in.

    Is there a way to do this?

    How would I go about doing it?

    thx

    Vanessa

    #94606
     Radu
    Moderator

    Hi,

    Please add this function to wp-content/theme/kleo-child/functions.php

    COPY CODE
    
    function KleoRemoveTopBarLoggedUsers() {
        $output = '';
        if (is_user_logged_in()) {
            $output .= '<style>
            .header-color.social-header { display: none !important;}
            </style>';
        }
        echo $output;
    }
    add_action('wp_head', 'KleoRemoveTopBarLoggedUsers');
    

    Let me know

    Cheers

    Radu

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

    I had to add a <type=”text/css”> to wrap code, but I got it working, thanks for your help!

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?