This support ticket is created Il y a 8 années et 8 mois. There's a good chance that you are reading advice that it now obsolete.
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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Sorry, I originally typed my request into the debug box.
I am trying to figure out a solution for creating custom shortcodes using types and views. I have a type of Site Variables with some custom fields on it. What I want to do is pull these custom fields into my content templates. There will only be one post in the Site Variables types which will contain all of my site variables. Currently when I insert with a shortcode into the content template for a site variable custom field there is nothing being shown.
You can use [wpv-post-field] short code in your View or Content Template to retrieve the custom fields, within the current post loop or from another post, like:
[wpv-post-field name=??my-custom-field?? id="99"]
where:
- "name" parameter defines the slug of your custom field (complete slug)
- "id" parameter defines the ID of the target post (whose custom field you want to grab)
You can create a short code to receive the same parameters as of [wpv-post-field] and can grab the required content. Following code does the same, you should add this in your theme's functions.php file: