Khalequzzaman

Remove 28px margin from admin bar

Jan 12th, 2016
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. /*
  2. * WordPress Coding By Khalequzzaman
  3. */
  4. function
  5. remove_adminbar_margin() {
  6. $remove_adminbar_margin =
  7. '<style type="text/css">
  8. html { margin-top: -28px !
  9. important; }
  10. * html body { margin-top:
  11. -28px !important; }
  12. </style>';
  13. echo $remove_adminbar_margin;
  14. }
  15. /* wp-admin area */
  16. if ( is_admin() ) {
  17. remove_action( 'init',
  18. '_wp_admin_bar_init' );
  19. add_action('admin_head',
  20. 'remove_adminbar_margin');
  21. }
  22. /* websites */
  23. if (!is_admin() ) {
  24. remove_action('init',
  25. '_wp_admin_bar_init' );
  26. add_action('wp_head',
  27. 'remove_adminbar_margin');
  28. }
Add Comment
Please, Sign In to add comment