Problem: I would like to display the description field from my taxonomy next to the taxonomy input in a Form.
Solution: The wpv-taxonomy-archive shortcode can be used in a taxonomy archive, but a custom shortcode is required to display a taxonomy description outside of a taxonomy archive. Example:
// Get the description of any taxonomy, for use anywhere // ex: [tssupp-get-tax-desc taxonomy="your-tax-slug"][/tssupp-get-tax-desc] // https://toolset.com/forums/topic/front-end-form-taxonomy-descriptions/ add_shortcode( 'tssupp-get-tax-desc', 'tssupp_get_tax_desc'); function tssupp_get_tax_desc($atts) { $atts = shortcode_atts( array( 'taxonomy' => '' ), $atts ); $taxes = get_option('wpcf-custom-taxonomies'); $description = isset($taxes[$atts['taxonomy']]['description']) ? $taxes[$atts['taxonomy']]['description'] : ''; return $description; }
Use it like this:
[tssupp-get-tax-desc taxonomy="your-tax-slug"][/tssupp-get-tax-desc]
Replace your-tax-slug with the slug of the taxonomy whose description you would like to display in the Form.
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-taxonomy-archive
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 |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 4 replies, has 2 voices.
Last updated by 3 years, 9 months ago.
Assisted by: Christian Cox.