WordPress.org

Ready to get started?Download WordPress

Forums

[closed] Hide Admin Bar from Logged Out Useres (13 posts)

  1. JoeMD
    Member
    Posted 1 year ago #

    Hey folks,

    I'm wondering how I can hide the WP admin bar from users who are logged out? I know this is possible as I've done it with a previous WP-powered site but I'm stuffed if I can find the option.

    Any help would be much appreciated.

    Cheers.

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    The Admin Bar isn't available to non-logged-in users by default.

  3. JoeMD
    Member
    Posted 1 year ago #

    Strange. When I log out of the site it still appears. See if it shows for you - http://www.mycollectr.com/

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Have you tried:

    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the Twenty Eleven theme to rule out any theme-specific problems.

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

  5. the1path
    Member
    Posted 1 year ago #

    The admin bar DOES show now in 3.3 all the damn time. I think this is a com[plete oversight on Automattics side regarding WP developers. Sure the bar might be useful for beginner bloggers etc but I have my own custom sticky menu which was obscured by the front end wp admin bar.

    However there is a simply fix. But there shouldnt have to be....give us the choice!

    Anyway put this in your header.php above the </head> tag:

    <?php if ( !is_user_logged_in() ){ ?>
    			<style>
                #wpadminbar{ display:none; }
                </style>
    		<?php } ?>

    Very annoying of WP to force this admin bar on people who dont want it. Dont get me wrong I actually like it but dont need it for logged out users and would prefer an option to disable in the admin panel instead of hacking yet more code into my theme files. Booooooooo WP :(

  6. keesiemeijer
    moderator
    Posted 1 year ago #

    The Admin Bar isn't available to non-logged-in users by default.
    Have you tried any of the steps esmi suggested?

    Try this plugin if you want it disabled for all roles except the administrator.
    http://wordpress.org/extend/plugins/global-admin-bar-hide-or-remove/

  7. the1path
    Member
    Posted 1 year ago #

    Really? I'll need to check my other sites to check as its displayed when users lig out on my beekeeping site. This does run buddypress right enough which now links into the wp admin bar.

    My solution works. I dont need a plugin.

  8. russoroni
    Member
    Posted 1 year ago #

    @ the1path I tried your code and at first it appears to be working but then when I try to login, my username and password is invalid.I take the code back out and my login works again. Any ideas? I'm a noob obviously.

  9. the1path
    Member
    Posted 1 year ago #

    @russoroni my code will not affect the login process. If your login breaks then I have no idea why. All my code does is use css to hide the admin bar. Did you make any other changes at all, add any other plugins at the same time?

    Did you double check you copied and pasted the code correctly?

    Other than that I have no idea Im afraid, code works perfectly for me.

  10. peter
    Member
    Posted 1 year ago #

    @the1path, buddypress has an option 'Show the Toolbar for logged out users' om its main settings.

  11. techwebdimensions
    Member
    Posted 1 year ago #

    thanks @the1path

    It works for me.

  12. M Rasid
    Member
    Posted 1 year ago #

    The bellow code I have used for my website http://www.public-post.com/ to hide admin bar for non logged in users and it is working.

    <?php if ( !is_user_logged_in() ){ ?>
    <style>
    #wpadminbar{ display:none; }
    </style>
    <?php } ?>

    The problem is now blank space, where the admin bar existed. Please take a look at http://www.public-post.com/

    How to makeup or remove this blank space. Anyone can help? please..

  13. the1path
    Member
    Posted 1 year ago #

    @M Rasid Check the CSS in Firebug or similar and see if its still applying a height to it.

Topic Closed

This topic has been closed to new replies.

About this Topic