-
Author
-
December 3, 2016 at 16:50 #145968HanifaParticipant
Hi there,
I would like you help to resolve a issue I didn’t have before.
Because of others issues I had, I had to uninstall and re-install the Theme KLEO and this with other things resolve a issue I had before.
But know I’m having some problems with the Admin Bar. Because if I choose in the Theme Misc, to hide, I also wont see it, and so I have to have a link directly to the back-end to go to wp-admin. And if I activated every users see the bar.
What I want is only admin and editores (moderatores) to be able to see the admin bar, and want to hide it for all the others members.
Can you help with the Theme Misc Admin Bar to do so? Maybe right some function and tell me where to put it.
I also leave here the credentials for login in my website if you need it.
December 5, 2016 at 20:03 #146105RaduModeratorHi
Set hide admin bar from admin -> theme options -> misc then add this code to child theme ( wp-content/themes/kleo-child/functions.php )
COPY CODEadd_action('after_setup_theme', 'add_admin_bar_for_admins'); function add_admin_bar_for_admins() { if (current_user_can('Administrator') OR current_user_can('Editor') ) { show_admin_bar(true); } }
Note : Child theme needs to be installed and activated
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 19, 2017 at 02:10 #158897MCDeditoraParticipanthi there!
I have the same issue and tried this but it didn’t work.
Any other idea?
Thanks in advance!April 20, 2017 at 14:03 #159060RaduModeratorHi,
@MCDeditora, Make sure to have child theme installed and activated.Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 22, 2017 at 23:21 #159336HanifaParticipantHi there,
I’m just a user of KLEO Theme,
But the only way you going to resolve that is by using this plugin:
Remove Dashboard Access
If you use this plugin, it will remove the dashboard access to all your users, include you.
For me to have acess create a bookmark in my browser in the link to gain access to WP back office.
This link it will look like this: sevethqueen.com/wp-admin/April 24, 2017 at 19:22 #159484RaduModeratorHi,
This snippet it works, I’ve tested
For me (Admin) it’s shown but for subscriber it’s hidden
COPY CODEadd_action('init', 'add_admin_bar_for_admins'); function add_admin_bar_for_admins() { if (current_user_can('Administrator') OR current_user_can('Editor') ) { show_admin_bar(true); }else { show_admin_bar(false); } }
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.