Hide WordPress User Bar When Logged In
-
Hi,
been working with bbpress, read through all the documentation and a lot of googling, and need to know how to hide the WordPress User bar when the user is logged in. bbpress is being used along with WooCommerce. The goal is to have a single login for members to have access to the forums.
Included is a screen shot.
https://www.dropbox.com/s/i6p1bsd9m6i1jlr/remove_bar.jpg?dl=0Thanks,
Kevin
-
Kevin,
How I hate the toolbar – it should only be seen by admins
add the following code into your functions file
add_filter('show_admin_bar', '__return_false');
Thanks Robin.
It worked a little too well in my case. On the front end the WordPress Toolbar was also hidden for Administrators. At least in my case.
Here is a code snippet that lets only Administrators see the WordPress Toolbar on the front end of a site. The toolbar is hidden for all other users.
https://support.woothemes.com/hc/en-us/articles/203107607-Hide-WordPress-Admin-Bar-for-Usersadd_action(‘after_setup_theme’, ‘remove_admin_bar’);
function remove_admin_bar() {
if (!current_user_can(‘administrator’) && !is_admin()) {
show_admin_bar(false);
}
}Thanks for your help. This can be added into the documentation overhaul.
Great – glad you’re fixed !
I dont get this logic, despite if it is only WP logic, not bbPress one.
Maybe I missunderstool it all. New Users (Roles = Subscriber, Participant) have access to add new Posts, and attach them to taxonomies.Forum Users are forum USers, not Portal editors of Articles.
This code should be in bbPress core. When you install bbPress you accept that whole platform is changed to something else, and old WP rules are not valid anymore.
For all other things Users have buddyPress profile Pages.
function splen_remove_admin_bar() { if( !is_super_admin() ) add_filter( 'show_admin_bar', '__return_false' ); } add_action('wp', 'splen_remove_admin_bar'); //don't allow users to go wp-admin add_action( 'init', 'blockusers_init' ); function blockusers_init() { if ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { wp_redirect( home_url() ); exit; } }
I dont get this logic, despite if it is only WP logic, not bbPress one.
Maybe I missunderstool it all. New Users (Roles = Subscriber, Participant) have access to add new Posts, and attach them to taxonomies.Forum Users are forum USers, not Portal editors of Articles.
@stagger-lee you may need to track back and look at any custom code you may have and see if any is granting users specific permissions that would grant your users to be able to do this. Of course your new forum users shouldn’t be able to do this by default. Regular subscribers/participants should only be able to edit their profile usually.
- You must be logged in to reply to this topic.