If you are logged in the wordpress site and viewing the front pages you will see Admin bar on Top. Sometimes it looks odd to see while viewing the site. Personally, I don’t find much use for it. I feel it’s just a ugly bar to me while admin bar shows at top of the page with only some of the options. So, I quickly come up with this solution to hide/remove the admin bar from the front end while visiting site.
add_filter('show_admin_bar', '__return_false');
OR, show_admin_bar(false);
OR use below code for all users who can’t edit posts
add_action('set_current_user', 'hide_admin_bar'); function hide_admin_bar() { if (!current_user_can('edit_posts')) { show_admin_bar(false); } }
-> insert the below code under wp_head() function
if ( is_user_logged_in()) { ?><style type="text/css"> #wpadminbar { display: none;} </style> <?php } ?>
Choose a suitable option to use in your site to implement. Further if you have any problem you are feel free to ask through comment.
This post has already been read 2596 times!
What is Lead Capture: In general sense lead capture designates a process or way of…
Introduction Unlimited Modal POPUPS on MouseClick: Everyone knows about popup during site visits and most…
Brief about Pregnancy Calculator : This WordPress Pregnancy Calculator plugin allows users to display an…
Introduction About this Service Plugin: This Visual Composer Service Plugin works as an addon to…
Introduction of Dynamic Query String : This plugin allows user to set dynamic query string…
There is an occasional bug for iPhone and iPad even they are designed as well and…