Skip Navigation

[Resolved] Echo single field php

This support ticket is created 5 years, 5 months ago. 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.

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 1 reply, has 2 voices.

Last updated by Beda 5 years, 5 months ago.

Assisted by: Beda.

Author
Posts
#1262635

Hi support,

I'm simply trying to echo a custom field value like this echo types_render_field("company");

It almost works but it shows the id of the post. Any idea how to solve this?

Thanks,
Menno

#1262877

We have an extensive Documentation about how to use the API of Toolset, or customize templates with PHP:
https://toolset.com/documentation/customizing-sites-using-php/

I think you'll find a good example of what you need to do here:
https://toolset.com/documentation/customizing-sites-using-php/functions/

For each field, there is an example of how to output in PHP. For example a single line:

types_render_field( "my-singlelinetext", array( ) )

To make the value visible you'll need to echo it, so

echo(types_render_field( "my-singlelinetext", array( ) ));

Can you confirm this works for you as well?