Disable Admin Bar just on your blog's home page

Hey guys! Add this code to your website so that you can disable the WordPress admin bar just on your blog’s home page. Enjoy!

Add this to your index.php

<?php
if ( is_home() ) {
add_filter('show_admin_bar', '__return_false');
}

else {
add_filter('show_admin_bar', '__return_true');
}
?>

That will disable the admin bar just for the home page, but it will leave a 28px padding on top.

To get rid of it just add this to your functions.php

function remove_admin_bar_style_frontend() {
echo '<style type="text/css" media="screen">
html { margin-top: 0px !important; }
* html body { margin-top: 0px !important; }
</style>';
}

add_filter('wp_head','remove_admin_bar_style_frontend', 99);

If you like this please donate some rep points (going for 1,000) :slight_smile:

Thanks.