Archived topic
Change banner photo for product categories
7 replies · Started by Ivan Cazorla on October 12, 2021
Hi,
Is it possible to choose a photo for the banner product category instead of the same miniature for the product category?
The top wide image.
Thanks!! Let me know :)
Hi there,
it would require custom development with Custom Fields, as you would need to be able to save a separate Image URL for each category. If you have that in place then we could look at the options for displaying that image.
Is that a separated plugin or I can do it with Elements from Generatepress?
I would have to set an image with text (optional) and make it show on product categories, right?
Thanks
I've already have that element created but only allows me to choose 1 photo. Do i have to make a new element for each category? That'd be a lot of work!
There are a couple of steps:
1. You would have to register a Custom Field for your Woocommerce Categories. There are some plugins like ACF that can do this for you, or this StackOverflow provides a code only solution:
https://stackoverflow.com/a/40183439
You will need to register a field to store your custom image URL.
2. The value ( ie. URL ) will be stored in the Term Meta. Using a GP Block Element - Page Hero, you can set a Dynamic Background using the Term Meta dynamic data option:
https://docs.generatepress.com/article/block-element-page-hero/
Ok, I've done step 1 with code only solution. What do I have to do now? Thanks!
Ok I've made it!! Thanks!!
Hi Ivan,
Once the step 1 is done, you can start step 2.
Have you run into any difficulties practicing step 2?