Skip Navigation

[Closed] Using types_render_field(..) outside the wordpress loop?

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 11 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 1 reply, has 2 voices.

Last updated by Caridad 11 years, 8 months ago.

Assisted by: Caridad.

Author
Posts
#15105

I know the post id and have the post object retrieved via get_post(..) function in wordpress. But this particular post won't be rendered within a wordpress loop. So how do I access a custom field if I know the field-slug and the post id?

I'm not being able to find a function that does this. Sounds like an expected behavior. Am I missing something?

#15134

Dear Dayson,

You can use this function to set the desired post as if you were in the loop:
http://codex.wordpress.org/Function_Reference/setup_postdata

Or you can access the field directly:
echo get_post_meta($post->ID, 'wpcf-field', true);

Regards,
Caridad

The topic ‘[Closed] Using types_render_field(..) outside the wordpress loop?’ is closed to new replies.