Archived topic
display product category image on header element
13 replies · Started by Heinrich on August 31, 2021
Hi Team,
I´m want to create a header with dynamic image of product categories but using featured image is not working and I tried some other term meta fields but its not working either. Can you please help me out with the right meta field name?
Thanks a lot.
Hi there,
are you using the Header Element ( not the Block Element ) ? If so try this PHP Snippet:
https://gist.github.com/diggeddy/6478d0b724bf6c5d680e9f0dd25e720c
Hi David,
no I´m using the Block Element.
Do you want the image as a background to the container or as an Image Block?
as a background image.
I´d like to display the description of the product category als well in a headline block. Can you please help me with that too?
These settings work for me:
Hi David,
yes I thought so too but for me those settings aren't working.
https://snipboard.io/jCsfOD.jpg
I deactivate all plugins but still no image.
Hi there,
Can you link us to the specific category archive page that doesn't have an image displaying?
I've checked the category archive pages on your menu and images seem to be loading.
Here's what I see on my end
Aquaristik - https://share.getcloudapp.com/NQuY7zQN
Hunde - https://share.getcloudapp.com/L1ureP10
Katzen - https://share.getcloudapp.com/OAunGz5L
Nager, Terraristik and Vögel also have their own images displaying.
Hi Elvin,
I created a header element specific for the main categories but the subcategories don't have an image:
see: https://tiershop.dndev.at/produkt-kategorie/kleintiere/hamster/
I changed it to Term Meta. And the Meta Name of: thumbnail_id
And that seems to have done the trick.
Let me know.
Yes that's it!!! Great thank you.
Can you please as well help me with the description of the product category after the title in my header element?
Awesome :)
Add a GP Dynamic Content Block and set the type to: Term Description
Hi David,
I always forget about the GP Dynamic content Block, it works!
Thanks for your help
Glad to be of help! And its great to see how you're using the Block Element Dynamic Data :)