whenever admin or any other user logs in a top bar menu ads up. Now I made login for everybody, so I do not want this bar.
First I added display:none
to admin-bar.css
, but the main problem is that wordpress is still adding a white line on the top with:
html {
margin-top: 28px !important;
}
How to remove this as this is causing some design flaws.
http://vudu.me/88
Has an article about it.
But basically
or also
I believe in your functions.php will disable it. Probably a better way than just hiding it thriough css
THe reason you still get the gap with the menu hidden is because WP adds this css as well
So a margin is added up top…. you could negate that css in yours, but just disabling the bar is probably better if that’s what you want to do
To remove the top margin left by the admin bar, it’s not enough just to set
show_admin_bar
to false. You also need to remove the admin bar bump callback:Add this function in functions.php of your theme
If you’re talking about the top bar that shows up with quicklinks for the admin, you can also disable it per user when you setup their profiles.
It’s just a checkbox in the admin under the profile.
The best way I’ve found to remove that white space (it’s not caused by the admin bar) is to search out this CSS in
style.css
:and switch the
2em
to0em
or some variation of the same. That will remove the white space.Disable the WordPress Admin Bar Using CSS
You only have to copy and paste the CSS code below in Appearance > Customize > Additional CSS, or your style.css file.
The CSS code to disable the toolbar is:
Only valid php solution:
1) For Front-End:
2) For Back-End (tricky solution per hook):
I don’t have access to the
functions.php
and I was trying to solve the same issue just via frontend with the Enfold theme I was using. Like the previous answer from @DavidTaubmann, I used the same CSS edit, but that will still leave a 28px blank space at the top of the page, so here is the solution that worked for me.From
your-wordpress-site.com/wp-admin
dashboard, go down toCopy and paste this:
For other helpful solutions you can refer to:
To remove the top admin bar you need to go to Users in the left Menu, then Edit the user and then disable the Show toolbar when viewing website checkbox. Save. Done.
Do this to all users.