This topic has 9 replies, 3 voices, and was last updated 9 years by PitrusCitrus.
-
Author
Tagged: toolbar
-
February 12, 2015 at 16:22 #45807blazej91Participant
Hi there,
here is an issue: when typical guest goes into my website, he can see an login/register toolbar on the top.
Check an attachment to see what do I mean.I don’t want anyone to see that toolbar, but also I want to have this toolbar for me, as an admin. Can you help me?
Best regards
BlazejAttachments:
You must be logged in to view attached files.February 12, 2015 at 16:24 #45809sharmstrModeratorCommon WordPress question. Please google it.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
February 12, 2015 at 16:35 #45813blazej91ParticipantThanks for advice, but it’s propably not it.
I found this: http://www.wpbeginner.com/wp-tutorials/how-to-disable-wordpress-admin-bar-for-all-users-except-administrators/Do you mean to add this piece of code to functions.php?
COPY CODEadd_action('after_setup_theme', 'remove_admin_bar'); function remove_admin_bar() { if (!current_user_can('administrator') && !is_admin()) { show_admin_bar(false); } }
I’m sorry my friend, but it’s just doesn’t work.
February 12, 2015 at 16:54 #45816sharmstrModeratorchange ‘after_setup_theme’ to init.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
February 14, 2015 at 13:29 #46075blazej91ParticipantI’m sorry but i dont understand. What is ‘init’, and what exactly should I do?
Thanks for your patience
Best regards
BlazejFebruary 14, 2015 at 14:11 #46076sharmstrModeratorCOPY CODEadd_action('init', 'remove_admin_bar'); function remove_admin_bar() { if (!current_user_can('administrator') && !is_admin()) { show_admin_bar(false); } }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
February 14, 2015 at 14:35 #46077blazej91ParticipantYes, perfect, it works. Thank you.
Wish you all the best from Poland.
BlazejAugust 2, 2015 at 15:43 #71218PitrusCitrusParticipantHi,
I have the same issue and this is definitely not a “Common WordPress question” as the first reply claims it to be.I’ve used WordPress for more than 5 years with multiple themes and never encountered this issue. The admin bar is never shown by default for no other than logged in users only.
There seems to be issues with the KLEO specific admin toolbar settings.
At: Theme Options > Miscellaneous > Admin toolbar.
When it’s set to ‘ON’, everyone who visits the site will see the WP toolbar. And when it is set to ‘OFF’ It does not show the toolbar even if you are logged in as it usually does. This is not a default WP setup.Is this a bug or why would anyone want to have the WordPress toolbar visible for all visitors? I don’t see why anyone would?
Also for the login redirect function options. Where you can choose ‘Default WordPress redirect’. When I choose that, it redirects me to the homepage after login, not to the wp-admin as WP default setup does.
Would be great if you could solve this issue so that we don’t need to make changes to the code. For example having a third option that is the actual WP default which displays the WP toolbar only for logged in users and not for other visitors.
Thanks for an otherwise great theme.
Regards PitrusAugust 2, 2015 at 16:20 #71221sharmstrModeratorThe option for the admin bar in theme options only initiates code if its set to off. So, by default, if its set to “on” it will follow the standard WP way of showing it to to logged in users and not guests. If your site is hiding it for non-admins perhaps its a plugin doing that. I know woocommerce will do that. Same for showing it to guests. If you have “Show the toolbar for logged out users” enabled in buddypress, then it will show the toolbar. Again, Kleo isnt doing this. You could’ve easily tested this by temporarily enabling the WP 2015 Theme.
Same thing for Default wordpress redirect. If you have BP enabled it will go to homepage. If you have woo enabled it will go to my-account.
Take Kleo completely out of the picture by enabling the 2015 theme. Only disable k-elements, nothing else. Dont make any other changes and test your site again and tell me if I’m wrong.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
August 2, 2015 at 18:08 #71241PitrusCitrusParticipantHi,
Thanks for the quick reply. The problem was as you mentioned, that the “Show the toolbar for logged out users” was enabled in BuddyPress settings. So it was not WordPress nor KLEO, the “issue” was with BuddyPress. Did not know that buddypress had the option to show the toolbar for all users.
This solved the problem without the need for a code change =)
Thanks,
Pitrus -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.