-
Author
-
August 29, 2013 at 20:44 #1987HarvinderParticipant
Hi,
How do I remove the admin bar for all users apart from the “Admin”?
I have tried: WP Admin -> Sweetdate -> Miscellaneous -> Admin toolbar -> Off
but this doesnt work.
How do i achieve this?
Thanks
HarvinderAugust 30, 2013 at 00:00 #1992SQadminKeymasterThat normally works. Do you have any plugins that could set the admin bar?
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAugust 30, 2013 at 08:20 #2000HarvinderParticipantHi,
When I set the settings to off, the admin bar is removed from the front-end for all users.
HoweverIi still want it visible for the Admin only.
Thanks
HarvinderAugust 30, 2013 at 09:16 #2010SQadminKeymasterIf you want it only for site admins add this code to sweetdate-child/functions.php
COPY CODE/* Amin bar only for admin */ add_action('after_setup_theme','kleo_my_bar'); function kleo_my_bar(){ if (is_super_admin()) { add_action('wp_footer','wp_admin_bar_render',1000); add_filter('show_admin_bar', '__return_true'); } }
Make sure to have the sweetdate-child theme activated for it to work
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Ticket solutionSeptember 3, 2013 at 23:01 #2186girlinparisParticipantWhat do you use for any logged in users? I tried
if (is_site_user()) and it broke. lol
Just curious if you know off the top of your head. I’ll keep looking in Codex. 🙂
September 3, 2013 at 23:24 #2187SQadminKeymasteris_user_logged_in()
🙂Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 4, 2013 at 01:05 #2194girlinparisParticipantIt broke again 🙁 header already defined in pluggable.php
September 4, 2013 at 14:21 #2217SQadminKeymasterI don’t know what you are trying to achieve. Paste your code here. I am sure it has something misspelled.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 4, 2013 at 14:23 #2218girlinparisParticipantI only wanted the admin bar to show for users logged in. I have it fixed though.
February 10, 2018 at 14:13 #188242HarvinderParticipantHi,
Whats the updated code snippet? Im using the previously mentioned one and I have upset site_admin to super_admin but it is not working?
February 14, 2018 at 19:01 #188679AbeKeymasterHi, just updated it using is_super_admin()
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer. -
AuthorPosts
The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.