I've made a custom post type with 1 field. I want to show the value from that field (which is a file / URL) in a Divi theme builder template for another custom post type.
Apparently, Divi can't seem to do that, so I created a content template in Toolset (just a button with the dynamic URL), which I would like to insert in my Divi template.
How do I do that? Can I use a shortcode, and if yes, which one? Or is it possible to show the value in Divi another way?
Hi,
Thank you for contacting us and I'd be happy to assist.
To show values from Toolset Types custom fields, you can use the Types Fields API shortcode, as explained at:
https://toolset.com/documentation/customizing-sites-using-php/functions/#file
For example, to show value from the field with slug 'file-field' from the current post:
[types field="file-field"][/types]
And to get the value from the same field, but from some other post with ID '1234', you can use the 'item' attribute:
( ref: https://toolset.com/documentation/user-guides/views-shortcodes/item-attribute/ )
[types field="file-field" item="1234"][/types]
Note: In Divi builder, you can use this shortcode in any widget that supports shortcodes.
I hope this helps and please let me know if you need any further assistance with this.
regards,
Waqar