Tagged: x
-
AuthorPosts
-
March 17, 2017 at 9:35 pm #1411752
DrasciaParticipantHi,
I am trying to remove the WP toolbar from all non-admin users and I’ve tried adding in the functions.php:
add_action('after_setup_theme', 'remove_admin_bar'); function remove_admin_bar() { if (!current_user_can('administrator') && !is_admin()) { show_admin_bar(false); } }… but it did not work. So then I tried adding this instead:
add_filter('show_admin_bar', '__return_false');Still no luck… Please help? I have attached screenshots as well.
URL: https://oec2018.ca
March 17, 2017 at 9:38 pm #1411760
DrasciaParticipantThis reply has been marked as private.March 18, 2017 at 5:55 am #1412029
ChristopherModeratorHi there,
Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
After activating child theme, please add your code in child theme’s functions.php file.
Thanks.
March 18, 2017 at 8:43 am #1412105
DrasciaParticipantHey again,
I’ve installed the child theme, but still no luck! What could be going wrong?
Thanks
March 18, 2017 at 12:27 pm #1412211
ThaiModeratorHi There,
I navigated to this page: https://oec2018.ca/wp-admin/admin.php?page=rua-settings
After that checked on the Hide Admin Toolbar for Users option, the WP Admin bar disappeared.
Regards!
March 18, 2017 at 2:06 pm #1412246
DrasciaParticipantHi,
That’s fine but what happened to my website?? Everything is out of place now.
March 18, 2017 at 2:23 pm #1412253
DrasciaParticipantPlease disregard, everything has worked out. Thank you very much for your help!
March 19, 2017 at 5:21 am #1412642
ThaiModeratorIt could be the plugin conflicted with your custom code.
If you need anything else please let us know.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1411752 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
