How can I display my Custom Fields created with Toolset, using PHP code?
There are 2 possible approaches to display Custom Fields with code.
Using the WordPress API or the Toolset API.
Toolset API example for a single line field:
echo (types_render_field( 'field-slug', array() ));
(Note that in the
array()
you can also pass a Post ID and more arguments as shown here)
This will output the Field "field-slug" on the Single Post where I saved this Field.
WordPress API:
echo (get_post_meta( $post->ID, "field-slug", false ));
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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | - | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 |
- | - | - | - | - | - | - |
Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)
This topic contains 9 replies, has 2 voices.
Last updated by 6 years, 8 months ago.
Assisted by: Beda.