Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,

    You need to add custom code to achieve this. Follow the link – click here

    Install and activate OceanWP child theme and add the code as per your need to the functions.php file of the child theme.

    Thread Starter TheRewardsDude

    (@therewardsdude)

    Hi. Sorry for the REALLY LATE REPLY. How do you use this on the top bar?

    Hello,

    Add the below code to the functions.php file of the child theme and check it works or not.

    // Topbar conditional display
    function topbar_conditional_display( $return ) {
     
        if ( is_user_logged_in() ) {
            $return = flase;
         } else {
            $return = true; 
        }
    
        // Return
        return $return;
        
    }
    add_filter( 'ocean_display_top_bar', 'topbar_conditional_display' );
    Thread Starter TheRewardsDude

    (@therewardsdude)

    The code and everything seem to work but it the top bar didn’t disappear when I wasn’t logged in.

    Hello,

    Topbar will disappear only when a user logged in otherwise it will display according to the above code. Modify the code to make it as per your need.

    Thread Starter TheRewardsDude

    (@therewardsdude)

    Hi. I fixed the code and it worked. Thank you very much for helping me.

    You’re welcome!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Hide top bar to logged in users.’ is closed to new replies.