Skip Navigation

[Resolved] Post Type template as code in theme

This thread is resolved. Here is a description of the problem and solution.

Problem:

Use post PHP template in views.

Solution:
Unfortunately no, your view will display using the filter output layout. So there isn't a way to use a php template to do this ?

This support ticket is created 6 years, 11 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
- 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 2 voices.

Last updated by Shane 6 years, 11 months ago.

Assisted by: Shane.

Author
Posts
#606502

Hiya,

I'm using a Timber based theme, and I was wondering if it was possible to bypass the content template's through the GUI and code teasers etc for post types in my theme, and then use those templates in views results etc.

Example:
Post type - Event
View - displays a list of events sorted by run date, with filters for 'genre' taxonomy and 'venue' text options
View output - instead of using the shortcode based options in the view editor, I'd like to use a template file (e.g. for defualt WP archive pages I use the following twig code to load a teaser template - {% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}), so my teaser layout is controlled in the theme and can be reused across several views. I also prefer the logic of having front end markup related templates in code together in the theme, so I can see what templates are controlling what outputs etc.

I hope that makes sense,
Many thanks
Harry

#606543

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Brian,

Thank you for contacting our support forum.

Unfortunately no, your view will display using the filter output layout. So there isn't a way to use a php template to do this 🙁

Thanks,
Shane