[Resolved] Yoast Breadcrumb Hook

Home Forums Support Yoast Breadcrumb Hook

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1349896
    Ciji

    Hi,

    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.

    #1349925
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Perhaps the generate_before_main_content hook would be better? Depending on your Event templates, it should add them there as well.

    #1350161
    Ciji

    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

    Thoughts?

    Gratefully…

    #1350851
    Tom
    Lead Developer
    Lead Developer

    That’s strange about the before_main_content hook – 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_container work by adding some CSS to reduce that space. Let me know if you want to try that πŸ™‚

    #1351205
    Ciji

    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.

    #1352081
    Tom
    Lead Developer
    Lead Developer

    Aha! Can you try giving the hook a smaller priority using the “Priority” option? Something like 2 would be good. That should prevent it from hiding behind the other elements.

    Let me know if that fixes it (and the spacing) πŸ™‚

    #1353023
    Ciji

    That worked!

    Thank you, thank you, thank you.

    And Happy 4th!

    #1353149
    Tom
    Lead Developer
    Lead Developer

    Glad I could help! You too! πŸ™‚

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.