maxyudin

Disable/Remove Wordpress 3.3 Admin Bar

Mar 26th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. if( !function_exists('disableAdminBar') ) {
  2.  
  3.     function disableAdminBar() {
  4.  
  5.         remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
  6.         remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
  7.  
  8.         function remove_admin_bar_style_backend() {
  9.             echo '<style>body.admin-bar #wpcontent, body.admin-bar #adminmenu {padding-top:0px !important;}</style>';
  10.         }
  11.  
  12.         add_filter('admin_head', 'remove_admin_bar_style_backend');
  13.  
  14.         function remove_admin_bar_style_frontend() {
  15.             echo '<style type="text/css" media="screen">
  16. html {margin-top:0px !important;}
  17. * html body {margin-top:0px !important;}
  18. </style>';
  19.         }
  20.  
  21.         add_filter('wp_head', 'remove_admin_bar_style_frontend', 99);
  22.     }
  23. }
  24. add_action('init','disableAdminBar');
Advertisement
Add Comment
Please, Sign In to add comment