The admin bar doesn’t show for users of the site, and been trying to track down why. I contacted the theme developer, who spotted the screenshot below.
https://pasteboard.co/HuVJN98.png
Now sitewide notice is a part of Buddypress, so am wondering how to fix this? I still don’t want the bar showing to non logged in users.
HI Audiomonk,
That sidewide notice simply is keeping a track that the admin bar is off. It is not doing anything to hide it.try something like this
add_action( 'template_redirect', function () { show_admin_bar(true); });
See if it restores. Something is filtering on the adminbar and hiding it. It could be the theme or any of the plugin(For example, WooCommerce does it by default).
Try searching for the filter ‘show_admin_bar’ or the function ‘show_admin_bar’ and see if a plugin/theme is overriding it with false value.
The above code tries to reset the admin bar visibility on template_redirect. Most probably some code is doing it at even further actions like wp_head or so.
Still haven’t found out what’s causing it, I did use a modified version of your code above, which has brought it back. I’ll look for what’s causing the problem at a later date, this one took up too much time.
Thanks very much for your help Brajesh as always.
You are welcome. I am glad it is back. I will still suggest finding the root cause and fixing it for future 🙂
You must be logged in to reply to this topic.