Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #189122

    Hi,

    Not sure if this is caused by the upgrade of wordpress to the latest version. Suddenly the WP admin bar shows on the top of the theme.

    How can I disable it for public visitors?

    thank you,

    #189123
    This reply has been marked as private.
    #189574

    Hi!

    Insert following code into the theme functions.php file to hide the admin bar for all users except the administrator

    
    /* Disable the WordPress Admin Bar for all but admins. */
    if (!current_user_can('manage_options')){
      show_admin_bar(false);
    }
    
    

    Best regards,
    Peter

    #189575

    Thank you, Peter. Hope you are doing well! :)

    I need to hide the admin bar for only subscribers. How can that be achieved?

    And, why the site is showing admin bar even for visitors? This was not seen before.

    Thanks,

    #190066
    #190202

    I thought this was related to the theme but it turned out to be a bug with one of the plugins. After installing the latest version of that plugin, the issue is gone.

    thanks!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘how to hide admin bar?’ is closed to new replies.