Skip Navigation

[Resolved] Use a WordPress template for post type

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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by markusM-5 1 year, 5 months ago.

Assisted by: Nigel.

Author
Posts
#2640999
Screenshot 2023-09-05 at 15.46.33.png

Tell us what you are trying to do?

I don't want my default theme page.php template to be the base for my post-type. I have made a custom WordPress template (Presentation) that I want to be used with a specific post-type. I see that it is possible to make content templates but these does not allow me to change the template or make possible what I want to do. I want to use the Presentation template as the base for my post-type posts. Is there a way to do this?

Thanks so much 🙂

#2641067

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

The normal way to use a custom PHP template for the output of a custom post type is to name your PHP template according to the WordPress template hierarchy. See https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post

So if you had a post type with a slug of portfolio, for example, then creating a single-portfolio.php template would ensure that is used to display your portfolio posts.

(Toolset templates let you design custom templates within the back end UI, but they only replace the part of the page normally output by the_content function in your theme template file.)

#2642505

I will just use another solution then even though I would like this to work. Thanks for your help 🙂