Remove annoying WP Adminbar CSS

Question

I am trying to remove the annoying WP Admin bar css.

<style type="text/css" media="screen">
html { margin-top: 32px !important; }
* html body { margin-top: 32px !important; }
Traversy Media screen and ( max-width: 782px ) {
    html { margin-top: 46px !important; }
    * html body { margin-top: 46px !important; }
}
</style>

I have tried (according to other OLD answers):

/**
 * Remove admin bar CSS
 */

  function remove_admin_login_header() {
      remove_action('wp_head', '_admin_bar_bump_cb');
  }
  add_action('get_header', 'remove_admin_login_header');

It does not work.

0
, , FooBar 4 months 0 Answers 61 views 0

Leave an answer