Post Type Templates in 4.7


WordPress has supported custom page templates for over 12 years, allowing developers to create various layouts for specific pages. While this feature is very helpful, it has always been limited to the ‘page’ post type and not was not available to other post types. With WordPress 4.7, it will be. By opening up the page template functionality to all post types, the template hierarchy’s flexibility continues to improve.
In addition to the Template Name file header, the post types supported by a template can be specified using Template Post Type: post, foo, bar. Here’s an example:
1234567
That way, you’ll be able to select this full-width template for posts, pages, and products.
When at least one template exists for a post type, the ‘Post Attributes’ meta box will be displayed in the back end, without the need to add post type support for ‘page-attributes’ or anything else. The ‘Post Attributes’ label can be customized per post type using the ‘attributes’ label when registering a post type.
Selecting the post template
Selecting
Source: https://managewp.org/articles/13763/post-type-templates-in-4-7




source https://williechiu40.wordpress.com/2016/11/03/post-type-templates-in-4-7/