Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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. Thanks!

share|improve this question
add comment

5 Answers

up vote 8 down vote accepted

http://vudu.me/88

Has an article about it.

But basically

/* Disable the Admin Bar. */
add_filter( 'show_admin_bar', '__return_false' );

or also

//REMOVE ADMIN BAR
remove_action('init', 'wp_admin_bar_init');

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

html { margin-top: 28px !important; }
* html body { margin-top: 28px !important; }

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

share|improve this answer
    
Thanks! Voodoo! –  user385917 Aug 3 '11 at 11:14
    
Sure, don't forget to accept my answer if you are happy with it. The little checkmark to the left. That lets others know that the question is satisfactorily answered. –  Rev. Voodoo Aug 3 '11 at 11:21
add comment

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. Hope that helps some.

share|improve this answer
    
OMFG thanks! I lost so much time in function.php –  Christian Jan 8 '13 at 19:58
add comment

put this function in function.php of your theme

function hide_admin_bar_from_front_end(){
  if (is_blog_admin()) {
    return true;
  }
  return false;
}
add_filter( 'show_admin_bar', 'hide_admin_bar_from_front_end' );
share|improve this answer
add comment

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:

remove_action( 'wp_head', '_admin_bar_bump_cb' );
share|improve this answer
add comment

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:

#page {
    margin: 2em auto;
    max-width: 1000px;
}

and switch the 2em to 0em or some variation of the same. That will remove the white space.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.