Skip Navigation

[Resolved] Get the content of a content template assigned to a post type

This support ticket is created 5 years 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 1 reply, has 1 voice.

Last updated by francoisP-6 5 years ago.

Assisted by: Shane.

Author
Posts
#1463961

Hi Toolset Folks !

I created a post type, and assigned it a content template.
The post type has some basic fields used in the content template for display.

I want to insert this kind of post with a shortcode inside normal posts.
So in function.php I created a shortcode receiving the ID of the post I want to insert, and returning
get_post($id_arg])->post_content;

My problem is that this is empty, not containing the content template, which seems not to be parsed.

How do I get in PHP the content of a given post whose content is defined by a content template ?

Thanks in advance.

F.

#1464053

My issue is resolved now. Thank you!
Had to use render_view_template instant of standard wordpress post content.