Hi,
I am stuck and looking for a bit of advice.
What I'm trying to achieve: I want to display custom fields on my taxonomy archives. So, each category has an image and then I display that on the corresponding category archive page. etc
So far, straightforward.
First, do I need to use Term Fields to do this? I assume so. That's what I have been using.
I have created Term Field Groups, assigned them to the relevant taxonomies, etc etc all good so far.
So now I want to display them on my taxonomy archive pages. I follow this tutorial:
https://toolset.com/documentation/user-guides/views/displaying-wordpress-term-fields/#displaying-term-fields-with-views-without-writing-any-code
However, when I come to make my archive pages, and I’m trying to insert them to the template I’m creating via the block editor, I can’t see them?
Any advice?
Thank.
So, each category has an image and then I display that on the corresponding category archive page. etc...First, do I need to use Term Fields to do this? I assume so.
Hello, yes this sounds like a good use of term fields. Each category has a potentially different value for these custom fields, and you should be able to display these term field values in the corresponding term archive.
However, when I come to make my archive pages, and I’m trying to insert them to the template I’m creating via the block editor, I can’t see them?
Hi, term fields are unfortunately not currently integrated in the Block Editor. It is usually easiest to insert term fields into a Block-editor-based WordPress Archive using the Types termmeta shortcode. You can insert the Types termmeta shortcode in a paragraph block, or a Fields and Text block, or something similar. We have documentation for this shortcode available here:
https://toolset.com/documentation/customizing-sites-using-php/functions/
Click the orange "+ More" links shown with each field type to display examples of the termmeta shortcode for each field type, as well as different options available for the shortcode. In general, the format is like this:
[types termmeta="your-field-slug"][/types]
You would replace your-field-slug with the actual slug of your custom term field, and add any of the attributes necessary to format the field. For example, if you are displaying an image field, you will add the attributes like height, align, width, etc. as shown in this example:
[types termmeta="your-field-slug" alt="blue bird" title="Acme logo" class="my-class1 myclass2" style="border:1px solid black;padding:20px" size="thumbnail"][/types]
Let me know if you have questions about this and I'll give you some additional feedback.