Problem:
How to use taxonomy term fields in a conditional test on a taxonomy archive page so that the field can be tested to see if it has a value set before trying to display it?
Solution:
The usual format for custom fields in wpv-conditional shortcodes doesn't work for term fields on a taxonomy archive page, and it is necessary to insert the full types shortcode in the if condition, such as in this example:
[wpv-conditional if="( '[types termmeta='hex-colour' output='raw'][/types]' ne '' )"] <p>We have a hex value</p> [/wpv-conditional]
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 |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
This topic contains 2 replies, has 2 voices.
Last updated by 6 years, 9 months ago.
Assisted by: Nigel.