Skip to content

Instantly share code, notes, and snippets.

@martynchamberlin
Created October 25, 2014 03:36
Show Gist options
  • Save martynchamberlin/7bd8c368a1bcbc2eb813 to your computer and use it in GitHub Desktop.
Save martynchamberlin/7bd8c368a1bcbc2eb813 to your computer and use it in GitHub Desktop.
Remove WPAdmin Bar in WordPress
/**
* By default you can rmeove a single user's admin bar in WordPress.
* That's cool but the problem of course is that you have to do this
* for every single user. If you are using software like Wishlist
* Member where new users are being added all the time, this is bad.
* The solution is to programmatically remove the admin bar accross
* the board. I've experimented doing this several ways and this is
* the best one in my expereince.
*/
jQuery(document).ready(function( $ )
{
$('#wpadminbar').remove();
$('html').attr( 'style', 'margin-top: 0!important' );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment