Admin bar does not want to disappear

Following instructions for installing child theme and adding php to disable admin bar for all users except admin, I came to nothing-

Even if I do hide toolbar for this user, admin bar is still there, I dont want my subscribers to have any access to backend of the site,

regards

Hi,

I checked and your code looks correct.

Can you provide us a subscriber login credentials in Secure Note.

Thanks

No problem, here they are:

Hello There,

For more complete tutorial to hide the WP admin bar, please check out this article:
https://digwp.com/2011/04/admin-bar-tricks/

If none of this works, this could be a bug in the latest release of WordPress 4.8.1

Please let us know how it goes.

managed to hide it with ccs rule, for all users. but that’s better than anything

thank you for the help

You’re welcome!
We’re glad we were able to help you out.

Sadly that only led to another problem, bar disappears but now I have html space showing 30ish px that used to be bar, and I’m not able to remove it.

Any suggestions? How do I edit html only?

Hello There,

To resolve your issue, please update your custom css and make use of this instead:

/* hide the admin bar */
#wpadminbar { 
    display:none; 
}

html {
    margin-top: 0 !important;
}

Please let us know if this works out for you.

beautiful, thank you, I was not aware of the fact that I can edit html in css customizer :frowning:

one last thing, my underline in menu is purple, and I can not find anything that I have set purple in customizer or anywhere else
can you please take a look at that?

Hi There,

To change that color, pleas also add this CSS:

.x-navbar .desktop .x-nav > li > a:hover, 
.x-navbar .desktop .x-nav > .x-active > a, 
.x-navbar .desktop .x-nav > .current-menu-item > a {
    box-shadow: 0 2px 0 0 #e6c054
}

Nope, not working :confused:

Hello There,

The code should have work. It is overridden though because you have added in it in the wrong place. Please remove the code from the customizer, Appearance > Customize > Additional CSS and place it in Appearance > Customize > Custom > Edit Global CSS.

One thing to remember that this is the order of the styles being applied to a page:

  • Stack style.css
  • Child theme’s style.css
  • WordPress Additional CSS
  • Customizer’s Custom CSS
  • Cornerstone’s Custom CSS

Hope this helps. Please let us know how it goes.