'Create Shortcode in Wordpress for Toolset Types Custom Field to display Multiple Values as a RANGE
I am setting up a wordpress site Toolset types custom fields which allow multiple (numeric) values. Currently the field value output in a toolset view or single post page lists all the stored values for that field, for example as: 1, 4, 6, 8 in a row. I want to to display the min-max RANGE, if any, for that field instead, ie: 1-8 (or, if only ONE stored value: 1) Toolset shortcodes dealing with the display of types custom fields with multiple values, using a wpv for_each loop (https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-153482), is currently limited to which which field to do the loop on, which element in the for_each loop to start or end with and the separator between elements. But no ability to (pre-) sort the elements or to display by "first" and, if more than one value, "-last" element (ie when how many elements can be entered is not constant then is not possible to use a static "end" attribute) which would, in effect provide a low to high range of values to display. But for this i need to create a new shortcode and add it but am not sure how to achieve something of this level....
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
