Skip Navigation

[Resolved] Toolset Layouts and custom php content template

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

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 9 replies, has 2 voices.

Last updated by Luo Yang 6 years ago.

Assisted by: Luo Yang.

Author
Posts
#1150030

Hello,
how can I integrate a custom php template into toolset layouts?

#1150036

Hey I couldn't send a chat message on safari mobile. It seems to be a bug.

#1150043

Anyways, I have created a single-{cpt_slug}.php file

Inside the file I called get_template_part(). But now I am unable to render the output from those files.

I am using toolset layouts

And was wondering how I can render the output from the file instead of the layout?

And assign a custom php template to a page.

Regards,
Nick

#1150406

Dear Nick,

I suggest you create a custom shortcode using PHP codes, output the content of your "php template", then put the shortcode into layout.

More help:
https://codex.wordpress.org/Function_Reference/add_shortcode

#1150411

Thanks Luo. I got it to work.
Just wondering why doesn't Layouts let me render my custom php template?
I can not deactivate Layouts for a CPT.

Only if I deactivate the entire Layouts plugin it will work.

#1150417

The Layouts plugin works like a page visual editor, it does not support PHP codes directly, you can render layout content insider post content area, or you can edit your theme file, use function the_ddlayout() to render the layout content, see our document:
https://toolset.com/documentation/user-guides/develop-layouts-based-themes/#php-integration-for-layouts

#1150485

Hm... I need the default wordpress theme function to work. Is that supported with the layouts plugin?

#1150489

Please elaborate the question with more details:
What kind of default wordpress theme function do you want to work and supported with Layouts plugin?

Please describe detail steps to duplicate the same problem. thanks

#1150494

I have created a single-{cpt_slug}.php file

Inside the file I called get_template_part(). But now I am unable to render the output from those files.

If I deactivate the layouts plugin. It will work.

But for some reason the layout functions are overriding the custom php template.

#1150504

I have tried it in my localhost in a fresh wordpress installation, there isn't similar problem.

I suggest you try these:
1) In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2017, and test again
2) Save that specific layout(it will clear all cache related with that layout), and test again
3) If the problem still persists, please provide a copy of your website, also point out the problem page URL and layout URL, and the problem theme file(single-{cpt_slug}.php), I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/