Can I assign a template to a custom post type?

Can I assign a template file to a custom post type?

I have created a custom post type called items, and I would like to assign templates to the items like you can do with pages.


From WordPress version 4.7 you can now assign custom page templates to other post types along with page.

To achieve this in addition to the Template Name file header, the post types supported by a template can be specified using Template Post Type: as following.

Template Name: Full-width page layout
Template Post Type: post, page, product

You can get more information about it on the following pages.

Leave a Comment