[Resolved] Breadcrumbs not showing for all attachments

Home Forums Support [Resolved] Breadcrumbs not showing for all attachments

Home Forums Support Breadcrumbs not showing for all attachments

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #995967
    Alexander

    Hello,

    while trying to figure out a way to show the parent for my photos (see https://generatepress.com/forums/topic/template-for-attachments-image/) I found and added Breadcrumbs via Yoast SEO, via Elements / Hooks, and using “Media” (among others) as the Display option.

    Unfortunately, the breadcrumbs don’t show for photos that are attached to a PAGE – only for photos that are attached to a POST (at least as far as I can tell).

    Examples:

    https://www.alex-kunz.com/domelands-late-in-may/mud-hill-bowl/#main (attached to a post, breadcrumbs show)

    https://www.alex-kunz.com/photos/summer-dawn-at-garnet-peak/#main (attached to a page, no breadcrumbs)

    Looking at the source for the photo attached to the PAGE, it appears that the breadcrumbs item list is there – it’s just not showing.

    What am I missing?

    Thanks
    Alexander.

    #996543
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Which Hook are you using to insert the breadcrumbs?

    Let me know πŸ™‚

    #996551
    Alexander

    The hook I’m using is before_entry_title.

    #996826
    Tom
    Lead Developer
    Lead Developer

    That hook isn’t available on pages, as it’s meant for single posts.

    Instead, you’ll want to create another hook and apply it to the before_content hook, and apply it to Pages.

    It would be good to be able to add multiple hooks to one element – I’ll see what I can do about that πŸ™‚

    #996852
    Alexander

    Okay done (and fine tuned – with my existing hook on before_entry_title and the new hook on before_content the breadcrumbs would show up twice for media so I adjusted that).

    Now I have two Hook-Elements, one for Posts & Portfolio items on before_entry_title and one for Pages & Media on before_content. Confusing that the hook works or doesn’t work on media depending on the media attachment’s parent. πŸ˜›

    Anyway – I’ve got nice breadcrumbs showing where I want them now. Thank you!!

    #997325
    Tom
    Lead Developer
    Lead Developer

    No problem! πŸ™‚

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