Hi, i’m trying to disable the admin bar for logged in users apart for the administration role.
I use this code in the functions.php file but i doesnt work at all.
// show admin bar only for admins
if (!current_user_can('manage_options')) {
add_filter('show_admin_bar', '__return_false');
}
// show admin bar only for admins and editors
if (!current_user_can('edit_posts')) {
add_filter('show_admin_bar', '__return_false');
}
Can you tell me how to do it?
Thanks in advance
Hi,
Something like this will remove the admin bar for all users except admins
– https://www.wpbeginner.com/wp-tutorials/how-to-disable-wordpress-admin-bar-for-all-users-except-administrators/
You could give it a try, it should work fine.
Thanks
Hi Simion, unfortunately it doesn’t work. The code in the tutorial is much similar to the one i used before, anyway i have put in the functions.php file but nothing change! I still see the admin bar for non-admin users.
If you want, i can give you user/pwd for admin role so you can check out by yourself.
Thanks
I also tested that code. Here I logged with an author user role, admin bar enabled in WordPress settings and showing
– https://www.screencast.com/t/22f1euntyc0b
– https://www.screencast.com/t/RCtsTPZ0Trd
I then entered that code in the theme functions file
– https://www.screencast.com/t/LxwDzWDx
After forcing the page to refresh (sometimes needed), the admin bar for the author role is gone
– https://www.screencast.com/t/KibTqiAD5u
So the code works from what I can see.
There would be other methods to remove the WordPress admin bar, try some other solutions or even plugins
– https://premium.wpmudev.org/blog/remove-the-wordpress-admin-toolbar/
– https://codex.wordpress.org/Function_Reference/show_admin_bar
– https://wplift.com/hide-admin-toolbar
Thanks
Hi,
It would be best to create a child theme in that case, a child theme is provided in the theme package (code folder)
– https://forum.tagdiv.com/whats-included/
This is a guide – https://forum.tagdiv.com/the-child-theme-support-tutorial/
The child theme comes with a functions file, enter the codes there.
Thanks
Those are the patch files, files that were modified from the previous version to the new one.
If you want to update by patch you can use those files. Note that each patch is required if you update from an older version, you cannot skip one update. They are not cumulative, meaning that the last one does not contain all the previous ones.
That issue with the Cloud library was in some cases caused by plugins, you could check that as a first step. We also continually try to improve the plugin, which is in beta phase at the moment. Be sure to check the theme requirements guide as well
– https://forum.tagdiv.com/requirements-for-newspaper/
How can i remove white space around the thumb image?
It looks like this: https://drive.google.com/file/d/1WrfG0WBdYrBdZmY92uvLBW3xjsJIJYfT/view?usp=sharing
and
I want to set it like this: https://drive.google.com/file/d/1rmj3IRaXZz6WSjxK4NzQ-2_aOUgW1fjp/view?usp=sharing
Thanks
