Advertisement
websupporter

Hide WP Admin bar with CSS

May 7th, 2015
3,063
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. add_action( 'wp_footer', 'hide_admin_bar_with_css' );
  3. function hide_admin_bar_with_css(){
  4. ?>
  5. <style>
  6.     #wpadminbar{
  7.         display:none;
  8.     }
  9.  
  10.     html{
  11.         margin-top: 0 !important;
  12.     }
  13. </style>
  14. <?php
  15. }
  16. ?>
Advertisement
RAW Paste Data Copied
Advertisement