Last Updated: February 25, 2016
·
1.288K
· pramodpandey05

How to remove html { margin-top: 28px !important; } from wordpress header

When you use wp_head() function in header.php at the end of the section.After using it automatically css apply margin-top 28px. So how to remove that margin top. It’s very easy you have to add in function.php file this code :-

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

1 Response
Add your response

I believe this margin is because you have admin toolbar enabled in /wp-admin/profile.php
http://i.imgur.com/QkgOUJl.png

over 1 year ago ·