Archived topic
Wordpress admin bar disappears on pages where Yoast breadcrumbs are disabled
3 replies · Started by Neil on July 4, 2021
Hi,
I've enabled Yoast breadcrumbs on most of my pages, except for the homepage and overall "landing pages" for topic areas which use a full-page layout. I excluded these types of pages in the Display Rules. Now, the Wordpress admin bar is no longer showing on the excluded pages.
Here's what I did step by step:
1. Set Yoast SEO > Search Appearance > Breadcrumbs > Enabled
2. Appearance > Elements > Add new element > created a hook for Yoast breadcrumbs using the following function:
<?php
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb( '<p id="breadcrumbs">','</p>' );
}
?>
3. Under "Settings" in the Edit Hook section, set the Hook to generate_before_content, execute PHP is ticked, Priority is set to 10
4. Under "Display Rules" in the Edit Hook section, excluded the pages where I didn't want the breadcrumbs displayed.
Now, the Wordpress admin bar has disappeared from the pages where the breadcrumbs don't appear. How can I make it display again?
Many thanks for your help!
Hi there,
thats odd, can't see why Yoast would cause that issue, and hooking an element into that hook would have no bearing on the admin bar.
Have you tried clearing any plugin/server/browser caches to make sure you're seeing the latest update ?
I tried clearing all caches repeatedly, to no avail. Then I upgraded to PHP 8 - and the problem disappeared! Still not sure what was causing it, but it's working fine now... Thanks for your help, David!
Glad to hear you found a solution!