Problem:
I want to render data of my Taxonomy Term Fields created with Toolset on a Taxonomy Term Archive.
How can I do that?
Solution:
You can use either get_term_meta() or types_render_termmeta(), to render the meta fields of a term.
The most important is not how you render it but what data you pass to the render functions, as that is often the core cause for the above 2 methods "not working".
In this ticket for example the problematic detail was the ID passed to the function (the ID is supposed to be the Term ID).
On Archives, having many posts, you can't get that ID with the classic single item methods WordPress offers but need to use the get_queried_object_id() function for example.
Relevant Documentation:
https://toolset.com/documentation/user-guides/custom-content/displaying-wordpress-term-fields/#displaying-a-field-for-a-specific-taxonomy-term
https://developer.wordpress.org/reference/functions/get_term_meta/
https://developer.wordpress.org/reference/functions/get_queried_object_id/
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | - | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 |
- | - | - | - | - | - | - |
Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)
This topic contains 2 replies, has 2 voices.
Last updated by martinE-4 4 years, 2 months ago.
Assisted by: Beda.