- This topic has 7 replies, 2 voices, and was last updated 2 months, 3 weeks ago by Tom.
July 2, 2020 at 2:09 pm #1349896Ciji
I’m using a hook to place Yoast breadcrumbs “before_content” throughout our staging site. It’s working great on most of the site but, on the Blog index page, it (1) adds the breadcrumbs just above the title of every post listed. (https://www.nwtw.org/staging/blog/) and (2) doesn’t show breadcrumbs on the Events index page or the single event pages (https://www.nwtw.org/staging/events/)
I have the hook set to display on the entire site, event archives and all events, but to exclude products and product archives.
Do you know of a way to adjust the hook so it (1) removes the breadcrumbs from above the title of the posts listed on the Blog index page and (2) adds them to the Events index page and single event pages?
Thank you.July 2, 2020 at 3:05 pm #1349925TomLead DeveloperLead Developer
generate_before_main_contenthook would be better? Depending on your Event templates, it should add them there as well.July 2, 2020 at 11:00 pm #1350161Ciji
Thank you for getting back to me so quickly.
I’ve tried the hook with all of the top of page locations.
before_content places the breadcrumbs in the same spot as the breadcrumbs woocommerce generates on our product pages (https://www.nwtw.org/staging/shop/writers-room/)- Which is the location goal for the rest of the site – but, of course, it doesn’t work properly on the blog and events pages.
When using before_main_content location, the breadcrumbs vanish on blog page and events pages, but are good on the rest of site.
When I use the inside_container (its up on the site right now) it works throughout site, but isn’t in the right spot. I can fix this a little bit by using a div and some CSS for the top and left margins, but the bottom margin between the breadcrumbs and the page heading is too large. I’ve only been able to fix this issue using CSS for the single event pages. (https://www.nwtw.org/staging/events/new-works-workshop-6/)
Here’s how the other locations display:
inside_site_container – same as inside_container
before_header – works throughout site, but wrong spot
after_header – works throughout site, but wrong spot
before_header_content – Breadcrumbs vanish throughout site
after header content – Breadcrumbs vanish throughout site
before_content – Perfect spot, but on blog index page, it (1) adds the breadcrumbs just above the title of every post listed and (2) doesn’t show breadcrumbs on the Events index page or the single event pages.
before_entry_title – breadcrumbs vanish on all pages except Blog and has same issue as before_content
Gratefully…July 3, 2020 at 9:44 am #1350851TomLead DeveloperLead Developer
That’s strange about the
before_main_contenthook – it should definitely exist on your blog pages at the very least. Are you using a child theme with any custom templates?
As for the Event pages, I wonder if they’re using a different template that doesn’t have the hooks we need.
We can likely make
inside_containerwork by adding some CSS to reduce that space. Let me know if you want to try that 🙂July 3, 2020 at 8:09 pm #1351205Ciji
I’m not using a child theme or any custom templates, but using “vanish” to describe what happens to the breadcrumbs when using the before_main_content hook wasn’t the best word choice. It’s more that the breadcrumbs get covered up by the content. When I set the breadcrumb div padding-left: 0px you can see the breadcrumbs peeking out on the left hand side. I have this set up on the site currently if you’d like to see it. https://www.nwtw.org/staging/blog/
I was able to fix the breadcrumbs on the event pages with inside_container and css.
I’d love to try and use css to make inside_container work by adding some CSS to reduce that space. That would be awesome.
Thanks again for your help.July 4, 2020 at 1:53 pm #1352081TomLead DeveloperLead Developer
Aha! Can you try giving the hook a smaller priority using the “Priority” option? Something like
2would be good. That should prevent it from hiding behind the other elements.
Let me know if that fixes it (and the spacing) 🙂July 5, 2020 at 12:58 pm #1353023Ciji
Thank you, thank you, thank you.
And Happy 4th!July 5, 2020 at 3:58 pm #1353149
- You must be logged in to reply to this topic.