Since WordPress version 4.7 Post-Type-Templates are enabled in the WordPress core.
You dont need to specify the templates in the register_post_type
function.
Instead, just create your post-templates like you would do with your normal page-templates.
So for example, duplicate the single.php file, rename it and add the following code to the top of the file:
<?php
/*
Template Name: My Post Template Name
Template Post Type: post, region
*/
After that, you should see a Post Attributes box in the backend, in this case on the post-types “post” and “region”, where you can select your template.
You can find some more info here https://make.wordpress.org/core/2016/11/03/post-type-templates-in-4-7/
You can also read about normal (old) page-templates in WordPress here.
I hope this is what you are looking for.
Related Posts:
- Using save_post to replace the post’s title
- How do I safely change the name of a custom post type?
- why doesn’t the_content() work in this {single-custom_post_type.php} page?
- Custom Post Type Menus
- Custom Taxonomy Template Post List with Sort Order
- Hiding Custom Post Type from Google?
- Display Custom Post Type Fields
- functions.php conditional tag only for custom post type
- Get monthly archives for custom post type
- Taxonomy page returns 404 page not found
- How to get dynamically custom post type that are under a certain category
- Single Page WordPress CSS and JS links
- WordPress query by multiple Custom fields and order by date
- Custom metabox translation
- Get all taxonomies for all post types
- How to make custom post meta wp_editor translatable?
- Lock post meta block at the bottom of a custom post type
- Linking three taxonomies with ACF
- How do I set the link in the Custom Post Type admin menu?
- How to List Thumbnails based on Custom Categories
- Add text to wordpress admin ‘Add Post’ edit
- After updating a page, all pages on the site used the index.php template
- Meta_query with relation ‘OR’ killing server CPU
- custom posts on different page
- WordPress posts with multiple fields
- show_in_rest false disable Gutenberg
- Pre_get_posts filter overwrites all search functionality
- How to add pagination to wp_query [duplicate]
- Custom Post Types and independent Categories – complex Taxonomy
- WordPress Ignoring My Custom Post Type Templates?
- Notice: Undefined index: suppress_filters
- Storing posts from query and accessing later via AJAX call
- If post has custom field then display css-class
- Give a permalink to Custom Post Types without title
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Custom Meta Field – Remove comma from string with str_replace
- List all posts in a custom post type with pagination (the correct way)
- Rewrite custom post type url – Multiple post types
- How to conditionally redirect to the post from a taxonomy page?
- Add post location with mile radius allowing search
- Category with post type pagination returns 404
- Adding the_content() in custom template email
- Cannot Create new Post within Custom Post Type
- set permalink for CPT
- Post 2 Post: Getting connected ‘person’ from post author
- Does WP have a global of $id?
- Check if post has specific tag_ID in custom post type
- Global custom meta box
- custom post type vs. conditionally displaying meta boxes for specific terms?
- data-type=”” … needed post tags stripped of characters
- Add first letter of titles to array, then compare arrays
- Bootstrap accordion looping through posts incorrectly
- Use Pages for Custom Post Type
- Search Filter CPT, Custom Loop
- Get post ID of either existing post or new post
- Create a simple Testimonial page
- How to call a post’s metadata in shortcode.php?
- Revert to previous dropdown options after change
- next page with custom post
- What should I learn to develop event management in wordpress? [closed]
- wp-includes does not contain a feed template
- Why is the output of a call to the_excerpt different when the call seems to be identical?
- What is the best way to manage small blocks of content on my home page?
- Only looping through pages that have children or subpages
- Two-way synchronizing of a post type among multisite blogs
- How to sort WP_Query by a custom text field (written as a date dd/mm/yyyy)
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- Custom post type rewrite url structure with taxonomy and sub taxonomy
- list articles in admin showing nested categories or slugs?
- How to upload two input files [closed]
- Custom Post Type with Category Separate
- URL issue retrieving Custom Post Types using Backbone JS API
- Custom metabox with image gallery upload that won’t attach images to post
- order custom post type posts by custom date
- Foreach result into WP_query
- Standard Page Child of CPT Not Found (404)
- Custom Post Type parent/child relationship rewrite rules for permalinks
- Related posts by taxonomies does not work , what could be the reason?
- Display first post of a term in taxonomy template
- How to transfer categories (default) to custom taxonomy?
- Query posts based on user preferences
- call a function when insert and update a custom post type
- How can I remove “Add new” button on custom post type
- Search attachments in custom post type only
- Same permalink structure for all post types?
- WordPress custom post type
- How to have working breadcrumbs with several taxonomies associated with a custom post type
- Custom Post type archives / categories give 404
- Sorting on Taxonomy in archive page
- Front-end form submission not creating post
- Pages displays correctly but returning a 404 error in http header.
- Custom options for a Custom post type
- Custom loop won’t work, can’t find problem
- link posts to custom post type
- Query by post type or category
- Most appropriate way to display CPT’s by children terms of custom taxonomies while retaining desired permalink structure?
- See the process of creating a taxonomy and tell me where I made a mistake
- Google Analytics Dashboard for WP in Custom Column
- CPT Template Option to Top
- Navigation won’t update to show full path to single post