Hi!
What is the error you get when you try it?
SportsPress doesn’t have any functions to force that bar to be displayed so it should work fine.
Kind Regards,
-Roch
Hi, I dont get an error as such, it just wont remove. I have tried a lot of plugins but none seem to work. I cannot hide the admin bar. I need the site to look just like a site for subscribers and no admin bar / dashboard or even profile editing to be available. I am really struggling with this one. I have also had issues with setting user roles.
Hi!
I recommend you trying different plugins then. Our theme or plugin don’t really change that.
Also you could add a bit of custom code to hide the admin bar for subscribers, it’s really simple and you could even code a plugin for that in less than 1h
Kind Regards,
-Roch
As Roch mentioned, this is not related to the theme, but here’s a simple function to hide the admin bar and disable admin access for subscribers:
function my_remove_admin_bar() {
if ( ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) && ! current_user_can( 'edit_posts' ) ) {
if ( is_admin() ) {
wp_redirect( home_url() );
exit;
} else {
show_admin_bar( false );
}
}
}
add_action( 'after_setup_theme', 'my_remove_admin_bar' );
Hi, thanks for the reply. I have a feeling it maybe due to some other plugins conflicting. I well remove or deactivate anything to do with admin bar etc and see his I get on. I have built the site now around the rookie template which I like so hopefully can keep that as it is. If only I knew for to code a plugin, that would be great. In looking to see a comparison between the free version and pro version of sports press to see how we will benefit from pro. Is there anywhere I can see this. Thanks again.
Hi Brian, thanks for the help also, please can you tell me where I need to put the code? I have not as yet edited and files, only through plugins. I have not attempted FTP access for fear of damaging my site? Can this be added to a custom CSS or something along those lines or does the actual file need editing?
Thanks again
@nparsons75 Download this file, unzip, and upload via WP Admin > Plugins > Add New > Upload Plugin
Hi Brian,
Is this a plugin then, if anything goes wrong will I be able to reverse the installation? Will it remove the admin for subscribers? Excellent, thanks so much for the help.
@nparsons75 Yes it will remove the admin for subscribers. You could allow access to the admin area, but still hide the admin bar if you want, by removing the line:
show_admin_bar( false );
The plugin itself doesn’t affect any of the data on your site, so you could easily revert back by disabling the plugin if it doesn’t work out.
Amazing, I will try it when I get home from work later today. I will let you know how I get on. Fingers crossed…. Thank you again for your time, really appreciated.
Alright then!
Let us know how it works!
π
Kind Regards,
-Roch