WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a login top bar I use for general users on the website front end and the admin like to use the wordpress admin bar. I am trying to find a way of hiding the login top bar for admin so they just use the wordpress admin bar (this is only enabled for admin). I would also like to change the CSS of the main container if admin is logged in.

I have been looking for code on Git hub and the web but can't find anything that has worked for me. Does anyone know if this is even possible?

share|improve this question
up vote 1 down vote accepted

You could use something like this if you have jquery included in your page:

if ( is_super_admin() ) {
    <script type="text/javascript">
    $( document ).ready(function() {    
        $("#IDofDivHoldingUserTopBar").css("display", "none"); // ID of user top bar
// ............................. OR     
        $(".ClassofDivHoldingUserTopBar").css("display", "none"); // class of user top bar
share|improve this answer
That is great thanks. works for me. – Ashley Briscoe Aug 13 '14 at 12:53

You can try with current_user_can() function.


if( ! current_user_can('manage_sites')){
share|improve this answer
This also works so I upvoted. – Ashley Briscoe Aug 13 '14 at 12:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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