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.
<?php
/*
Template Name: Full-width page layout
Template Post Type: post, page, product
*/
You can get more information about it on the following pages.
https://wptavern.com/wordpress-4-7-brings-custom-page-template-functionality-to-all-post-types
https://make.wordpress.org/core/2016/11/03/post-type-templates-in-4-7/
Related Posts:
- single-{$post_type}-{slug}.php for custom post types
- display different template based on post type
- previous_post_link() and next_post_link() with a custom post type?
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Setting a custom sub-path for blog without using pages?
- How do I display two separate taxonomy archives for two post types that share a single taxonomy?
- Multiple Single Post templates
- How to set a fall back template for a custom post type in a plugin?
- How to list/show all custom post types regardless of category?
- Need some templating advice for templating with custom post types and taxonomies
- How to query custom posts using a dynamic category
- Custom Post Type with Nested Taxonomy and Template Files
- Create Pages from Database
- Template tags to display custom post type posts in category template?
- custom post type archive template per custom taxonomy term
- Custom post type loops with different page templates
- Include different loop templates in search query
- Custom Post Type Templates?
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- Lock post meta block at the bottom of a custom post type
- How do I provide a “show all posts” link in a paginated term archive?
- How can I force custom post type to use a specific template?
- Multiple templates for a custom post type
- Plugin templates in which directory
- Using wordpress template tags within an array
- Include custom post type single template, but respect theme override of template if it exists
- Custom post type not using custom template
- Query with no terms uses index.php template instead of archive.php
- Create template for taxonomy results limited by Custom Post Type
- WordPress Custom Post Type Children Template
- Getting template_include to work when allow_url_include is off?
- 2 Templates 1 custom post type according url
- Migrating a taxonomy’s tags to the native category
- How to specify a template for a path like http://example.com/something?
- Custom templates for a specific category
- WordPress 3.9 not using custom template
- How to Create Template File for Parent Page of Custom Post Type
- Custom post_type search pages
- how to remove pages loading with the archive templates
- Custom posts template page
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- Add Previous/Next Buttons to CPT Single Pages Only
- Custom post types with categories in template
- Creating separate feeds for custom post types
- How to get_term_meta on single custom post?
- How do I find a way to create a global single.php for a custom post type?
- Templates for hierarchical custom post type
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Apply template by path/slug related to custom post type?
- assign different templates to custom post type with homepage loop
- How to get the current category with custom posts
- Assign a template to a custom post type when displayed by the main loop on the home page
- Custom permalink structure for remote content pages
- How to create a archive template for custom post type [duplicate]
- WP not recognizing custom post type / template
- Custom post type draft use wrong template
- Create a custom taxonomy template that loops through child categories in term order?
- My template won’t apply, theme still fallback to index.php
- Calling a div and content in php?
- Tag template not returning posts [closed]
- One Custom Post Type two different Templates
- Conflict in function to allow single post template based on category
- How to make post templates to include shortcodes only?
- On click some element i want to use some template
- Post template with breadcrumb needs to show page navigated from
- Custom Post Taxonomy Template Not Loading Properly
- Accessing download link from the loop with WP Download Manager Pro
- Turning archive templates to a page template maintaining the slug
- Templating advice sub posts of a CTP
- Custom post type option page template
- get_permalink() of page the enclosing page not posts
- How to override post-new.php with custom template
- How can I find out what template is my custom post type using?
- WordPress Custom Post Type – Post Attribute: Template. Template shows up and saves on the back end, but the default theme file is being rendered
- How to Create a Default Fixed Custom Posts layout for text and images
- Can I organise my custom post types by page?
- Why did permalinks setting affect the pages?
- I want to create an archive and single page for a custom taxonomy for a custom post type
- How to make a custom search template for custom taxonomy?
- Custom post type with two templates
- Custom Post Type tag taxonomy “Page Not Found”
- DIVs not showing correctly on CPT?
- Why isn’t my custom post type using the corresponding custom post template?
- custom post type plugin – single template
- Load different template for CPT (in loop) in my plugin?
- Search page for custom post type
- How can I pull information from my loop and divide them seperately?
- Custom Post Type Template based on Taxonomy
- Template with Custom Post Type (Custom Tables) does not work
- Specifying Default Template for Hierarchal Custom Post Type [duplicate]
- Most appropriate way to display CPT’s by children terms of custom taxonomies while retaining desired permalink structure?
- how to pass args for archive.php query?
- Navigation links to posts in current term shortcode
- How to make a template for a specific post of a custom post type?
- CPT Template Option to Top
- WP_Query is getting the post but the_post() not rendering any Post
- Apply text based styling done for a single post in WPBakery to all posts / create a template out of it [closed]
- Show my custom post id if a country or ip
- How to create custom page templates with default page layout framework?
- How can I produce multiple webpages with a different output based on one entry/Page/custom Page?