0

enter image description here]1,

This screenshot above shows the functions.php code snippet I tried to use to remove WordPress register/login top bar from my website but so far it haven’t worked. I included the code into a Wordpress plugin called code snippets.

(I included the custom code to code snippet Wordpress plugin because I wanted to to add content to my themes functions.php file without directly editing my themes files)

Please advise how I can get this code to work and remove Wordpress user register/login top bar from my website 🙏 🙏🙏🙏

Thanks..

2
  • What does the bar look like? Are you sure it’s the admin bar and not part of your theme? Mar 6 at 9:45
  • Is your site hosted on wordpress.com/pressable? If it doesn't work, what does it do instead?
    – Tom J Nowell
    Mar 16 at 11:00
-1

you can use this

add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
    if (!current_user_can('administrator') && !is_admin()) {
        show_admin_bar(false);
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.