[wp-hackers] Removing Admin Toolbar from Front-End

Frank Bueltge frank at bueltge.de
Tue Dec 20 18:32:38 UTC 2011


or this plugin http://wordpress.org/extend/plugins/adminimize/

or this small source:
add_action( 'init', '_mw_adminimize_remove_admin_bar', 0 );
function fb_remove_admin_bar() {
			wp_deregister_script( 'admin-bar' );
			wp_deregister_style( 'admin-bar' );
			remove_action( 'init', '_wp_admin_bar_init' );
			remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
			remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
			
			// maybe also: 'wp_head'
			foreach ( array( 'admin_head' ) as $hook ) {
				add_action(
					$hook,
					create_function(
						'',
						"echo '<style>body.admin-bar #wpcontent, body.admin-bar
#adminmenu { padding-top: 0px !important; }</style>';"
					)
				);
			}
			
			add_action( 'in_admin_header', '_mw_adminimize_restore_links' );
}


On Tue, Dec 20, 2011 at 6:56 PM, Lee Rickler <info at a5d.org> wrote:
> You can remove it using this plugin - simple click and it's gone and stays gone:
> http://wordpress.org/extend/plugins/point-and-stare-cms-functions/
>
> On 20 Dec 2011, at 17:42, Robert Lusby wrote:
>
>> In WP 3.3, everyone is saying you *can* remove the new admin toolbar from the frontend, but not from the backend.
>>
>> Fair enough - I understand why this is, and the story behind it, and how it's different from 3.2.
>>
>> But how do I actually remove the dam thing from the front end?
>>
>> If a user has it set on in their profile, it hard codes a 28px CSS margin in the top of my site!
>>
>> Can someone provide me the magic function that disables this on the front-end for everyone please?
>>
>> [Not the "login to your account, and uncheck the box method" - can you imagine having to do that for every user!!]
>>
>> Thanks loads in advance,
>> Robert
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list