Hello Summer Sale!
Exclusive season-opening discount on TheGem theme.
Limited time offer.

Okay
  Public Ticket #1688017
Admin bar
Closed

Comments

  • Kill_the_Circuit started the conversation

    How can I show the wordpress admin bar when i'm logged in as ADMIN but not if any other user is logged in? 

  •  7,280
    Oliver replied

    Hi, sorry, not quite sure what do you mean. Can you pls provide more details with screenshots?

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • Kill_the_Circuit replied

    Sorry for the unclear description. On the top of the screen there is this admin bar (see screenshot). If I am logged in as Admin it is fine and usefull but I also want to have other users on my website and I don't want them to see this bar. How can I do this? 

  •  7,280
    Oliver replied

    Hi,

    pls. provide the wp-admin and FTP access

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • Kill_the_Circuit replied

    Isn't there just some code I could write or edit in the function.php or anything like this?

  •  7,280
    Oliver replied

    Try to add this one:

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

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • Kill_the_Circuit replied

    Perfect! Thank you!

  •  7,280
    Oliver replied

    Welcome!

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver