Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Forum How-To (http://forum.bytesforall.com/forumdisplay.php?f=9)
-   -   [SOLVED] How to Disable Admin Toolbar (top of site) for all Users Other than Admins & (http://forum.bytesforall.com/showthread.php?t=19780)

New WordPress Fan Mar 1, 2013 06:10 PM

[SOLVED] How to Disable Admin Toolbar (top of site) for all Users Other than Admins &
 
Is there a simple way to disable the admin toolbar (at the top of the site) so that it will not be visible to any users other than Administrators and Editors?

I found this: http://digwp.com/2011/04/admin-bar-t...for-non-admins

But, where exactly in the functions.php file should you put their suggested code:

Code:

// show admin bar only for admins and editors
if (!current_user_can('edit_posts')) {
        add_filter('show_admin_bar', '__return_false');
}

I am using Wordpress 3.5.1 and Atahualpa 3.7.10.

Many thanks!

juggledad Mar 1, 2013 06:58 PM

a 2 second google search came up with this Hide Admin Bar 2013

New WordPress Fan Mar 1, 2013 09:47 PM

Thank you Juggledad.

I also found this one: http://wordpress.org/extend/plugins/profile-builder/ which gives options to select levels of users who can see the admin toolbar on the front of the site.

Also, FYI - I found that the above code did work inserted toward the beginning of the Functions.php file.

Many thanks.

lmilesw Mar 1, 2013 10:10 PM

A way to add that code to the functions.php without editing the functions.php is to use the Code Snippets plugin. This way that edit won't get overwritten in a theme upgrade.


All times are GMT -6. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.