Disable admin bar
-
Hi,
is there any way to disable admin bar for users and not for admin?
Best Regards
-
Try this in your theme / functions.php
function splen_remove_admin_bar() { if( !is_super_admin() ) add_filter( 'show_admin_bar', '__return_false' ); } add_action('wp', 'splen_remove_admin_bar');
get a plugin from wordpress.org instead theme functions.php should bd code for the theme only
There are times when it’s worth remembering that a theme is not necessarily just a bunch of visuals but the directory that contains the crucial files, without which a site will not function and that not all sites hop around changing themes on a whim which would be very poor practise from a business site point of view. I get why people say a theme should only contain theme related code, but this applies to themes as they might be released to a repo for general download and can not have any notion of what a site user might need to do and then yes theme files mustn’t contain this sort of function, but as asked in this thread and as long as the OP understands what it means to keep that code in a theme that then isn’t portable across themes although perhaps a must always have requirement then it’s fine to add to functions.php.
Hi,
Long explanation Hugo but a good one. Yes, i will make specific plugin for this. I’m just getting tired of all plugin here and there. I have like 40 plugins installed. And those i really need.
Best Regards
I did find a plugin now that correct this easy.
Global admin bar hide or removeThank you anyway
Best Regards
Disagree because the adminbar persists regardless of theme
- The topic ‘Disable admin bar’ is closed to new replies.