Show value of custom field of custom taxonomy
-
Hi there,
Newbie here!
I’m a beginning WordPress developer and I’m working on my first client website for free so that I’m getting some practice.
Now I’m running against two problems which I don’t know how to solve. I already created a topic for the first one. And for this topic I hope you can help me with the second.
Your help will not only result in solving the problem but also in my learning. So I thank you in advance!
To understand the issue…
I’ve created a custom taxonomy with CPT UI. And then I created a custom field of the field type ‘image’ for that custom taxonomy with ACF.
Normally, when a post has a custom field, returning or displaying its’ value is relatively straightforward with the get_field() or the_field() and in the case of an image also the wp_get_attachment_image() function. However in this case, I’m trying to show the image of a custom field that’s inside a custom taxonomy.
To be more precise, this concerns a webshop that sells food supplements. And I created a custom taxonomy called ‘certificates’ for WooCommerce products. Those certificates are for things like ‘organic’, ‘non-gmo’, ‘vegan’, etc.
With this setup I can select for every product which certificates apply. And it’s possible for a product to have multiple certificates.
Now, I’d like to show the images of all the certificates that apply for a specific product on the single product page of that product. And I’ve got no idea how to accomplish that with the functions made available by ACF because the custom field for those images isn’t inside the product itself but inside the custom taxonomy that’s selected for that product.
I hope somebody can help me solve this. Or at least help me get just a tiny step forward.
I’m looking forward to your support. Thank you in advance!
Sincerely,
Hashim
- The topic ‘Show value of custom field of custom taxonomy’ is closed to new replies.