This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
Assign a custom template to one or more post types
When you create a custom template in WordPress it will be available only to Pages by default. With this simple snippet, you can assign templates to one or more post types of your choice.
By declaring a ‘Template Post Type’ below the ‘Template Name’, you can assign your WordPress templates to multiple post types, including custom post types.
The ‘Template Post Type’ comment supports either a single value or a comma separated list of post type, such as in the example below:
/* Template Name: Full Width Page */
/* Template Post Type: post, page, product */
Adding this simple snippet will make your WordPress custom templates available to one or more post types that you specify.