- This topic has 5 replies, 2 voices, and was last updated 1 year, 11 months ago by Tom.
August 28, 2019 at 10:11 pm #995967Alexander
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).
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?
Alexander.August 29, 2019 at 10:21 am #996543TomLead DeveloperLead DeveloperAugust 29, 2019 at 10:28 am #996551Alexander
The hook I’m using is
before_entry_title.August 29, 2019 at 7:52 pm #996826TomLead DeveloperLead 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_contenthook, 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 🙂August 29, 2019 at 9:10 pm #996852Alexander
Okay done (and fine tuned – with my existing hook on
before_entry_titleand the new hook on
before_contentthe 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_titleand 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!!August 30, 2019 at 8:55 am #997325
- You must be logged in to reply to this topic.