Types Fields API: How To Display Field For Specific Post?

Reference: https://wp-types.com/documentation/functions/#image

One of my recent project is to use WP-Types to create certain custom post type and fields.

You can think of it as an alternative of Advanced Custom Field, but more options and functions.

My problem: I would like to display an image for a particular post. 

However, according to this link, it does not clearly said how to do it, even after reading the "Displaying Fields of Parent Pages"

And the following does not work:
print types_render_field('cover-image-english', array(
"width" => 150,
"resize" => 'proportional',
"id" => $item_id,
)
);


Later on when I dig into the code, the actual parameter is "post_id", not "id", which is mentioned in the reference link.

And the following works:

print types_render_field('cover-image-english', array(
"width" => 150,
"resize" => 'proportional',
"post_id" => $item_id,
)
);


Hope it helps someone.

Comments

Popular posts from this blog

TCPDF How to show/display Chinese Character?

How to fix fancy box/Easy Fancybox scroll not work in mobile

Wordpress Load balancing: 2 web servers 1 MySQL without any Cloud services