thachpham92

Untitled

Jun 4th, 2013
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. if (!function_exists('disableAdminBar')) {
  2.  
  3. function disableAdminBar(){
  4.  
  5. remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 ); // for the admin page
  6. remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); // for the front end
  7.  
  8. function remove_admin_bar_style_backend() { // css override for the admin page
  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() { // css override for the 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.  
  25. }
  26.  
  27. // add_filter('admin_head','remove_admin_bar_style_backend'); // Original version
  28. add_action(‘init’,'disableAdminBar’); // New version
Advertisement
Add Comment
Please, Sign In to add comment