Site logo

Archived topic

Breadcrumbs not showing for all attachments

5 replies · Started by Alexander on August 28, 2019

Viewing posts 1–6 of 6

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.

Hi there,

Which Hook are you using to insert the breadcrumbs?

Let me know :)

The hook I'm using is before_entry_title.

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 :)

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. :-P

Anyway - I've got nice breadcrumbs showing where I want them now. Thank you!!

No problem! :)

This archived topic is closed to new replies.