Hello friends, I brought you another WordPress tutorial. Hiding the admin bar from front-end is a must among the WordPress developers. Because, it’s not helping for us when we do some changes with fixed positions. Specially for fixed navigation. Because of that, there is a need to hide it before do anything again.

However, this tutorial will be very short and quick. Just log into your WordPress admin panel and go to the path (appearance->theme editor).

Then click on the functions.php file and paste the following code.

function frontend_admin_bar(){
if ( is_blog_admin() ) {
return true;
}
remove_action( 'wp_head', '_admin_bar_bump_cb' );
return false;
}
add_filter( 'show_admin_bar', 'frontend_admin_bar' );

After all hit on save button and see the magic. That’s all. enjoy the code and real all the articles in KDJ Guru blog.

Write A Comment