Skip to content

Instantly share code, notes, and snippets.

@Red724
Red724 / gist:9a2dfd32af4221dc5536450d6b8f61c3
Created July 1, 2020 00:20 — forked from strangerstudios/gist:5210214
Remove margin from html element when WordPress shows the admin bar.
/*
Admin Bar Tweak. This changes the default CSS added by WordPress to place the admin bar margin in the body element instead of the html element.
Add this code to your active theme's functions.php or a custom plugin.
*/
add_theme_support( 'admin-bar', array( 'callback' => 'my_admin_bar_css') );
function my_admin_bar_css()
{
?>
<style type="text/css" media="screen">