Tell us what you are trying to do? In my content template I want to know be able to enter a shortcode which will display a custom field NAME dynamically.
My field names are very long, and they also represent a question. The 'value' of the field is the answer to the question. If I change a custom field name (ie I need to change the question), I don't want to have to type this in manually into my content template, otherwise that means I need to change things twice. Surely I should be able to just dynamically load the field name, and then also separately be able to dynamically load the field value? Thanks for your help 🙂
Is there any documentation that you are following? I am looking at this page but it seems to suggest that this is not possible = https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-post-field
Is there a similar example that we can see? No
What is the link to your site? Supplied above
Hi, it really depends on the type of field. In general, the Views shortcode wpv-post-field is designed for displaying the raw field value stored in the database. If you want to display the field name instead, the Types shortcode is more appropriate. Depending on the type of field it is, it may or may not be possible with the shortcodes provided by Types. A Numeric field name, for example, can be displayed as shown here, but some other fields do not provide this format option:
[types field="my-number" format="FIELD_NAME"][/types]
Examples of shortcodes for the different field types are included here: https://toolset.com/documentation/customizing-sites-using-php/functions/
Click "+ More" below any field type to show several examples of post fields, user fields, term fields, and their PHP equivalents. There is a bug right now in the documentation and shortcode tags are displayed as curly braces {{ }} instead of square braces [ ], so be aware when copy + pasting you may need to replace those characters. Our documentation team is aware of this problem and hopes to fix it soon.
If you have a question about a specific field type, let me know.