For an easy solution, you could just create page templates and set their Template Post Type
to match your custom post type. WordPress has supported custom page templates for other post types than page too since version 4.7.
You can read more about it from the Theme handbook // Creating page templates for specific post types
This way you could use the native template selector that you can already see on a page’s edit screen on the Page Attributes metabox.
Would this be a viable solution for you?
Related Posts:
- single-{$post_type}-{slug}.php for custom post types
- Template for specific post of custom post type
- Multiple Single Post templates
- Custom Post Type with Nested Taxonomy and Template Files
- Single page template for custom post_type
- Trying to manage templates on a blog with lots of custom taxonomies
- WordPress Template Hierarchy
- Include custom post type single template, but respect theme override of template if it exists
- WordPress Doesn’t Generate Taxonomy Archive
- Custom Empty Results page for my Custom Post Type
- Templates for hierarchical custom post type
- Custom Post Type homepage template
- taxonomy – templates are not loading
- Templates for CPT not working
- WordPress Custom Post Type – Post Attribute: Template. Template shows up and saves on the back end, but the default theme file is being rendered
- Single taxonomy for different custom post types
- Custom Homepage As Single Page or Custom Post Type?
- Can I assign a template to a custom post type?
- What is singular.php?
- Custom Post Type Plugin: Where Do I Put The Template?
- Searching multiple custom post types and pages
- CPT Template Not Showing – Getting 404
- Taxonomy, Terms, and Template Files
- Using Templates with Custom Post Type UI
- Get page by template?
- Custom Post Type Archive URL takes over page URL
- Is it possible to have an index page for taxonomy term for each custom post type it is assigned to?
- Custom Post Type Archive Template
- Custom templates for posts like for pages: page-{id} vs single-{id}
- Posts in Multiple Columns and Rows with one single loop
- Display different gutenberg template from selected post attributes
- Clean URL permalink for custom post type
- where can I see my custom post type archive template?
- Display posts of child category in template
- custom taxonomy – Template not working
- Create separate template for shared custom taxonomy with shared terms
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- Pagination Issue: Custom Post Type In Index
- Create second custom 404 page for selected post type
- Custom post type and taxonomy permalinks – Structure
- Trying to edit the single page from a Custom Post
- Custom Taxonomy term archive template
- Create Template for Custom Post Type same like for Page
- Custom template page with custom archives listing by user
- Custom post type content using custom fields without template
- Custom taxonomy and custom post type – wrong permalinks and template
- Can I override a CPT template on a per post basis with Gutenberg block editor?
- How to use custom template files in deeper directory?
- A case for Hierarchical Custom Posts
- Custom taxonomy returns 404
- Flush Rewrite Rules when new site is created on network
- Archive for a Taxonomy of a Custom Post type
- Custom post type pages return 404 page?
- Set templates for custom post types
- Main query not querying any posts in custom taxonomy template
- make permalink go to a custom single.php file
- Which file/template is in charge of taxonomies for custom post types?
- Custom Post Type setup
- Custom post type is using the index.php template
- Template code to split a post and print a custom field?
- How to create a template to show child terms of a MAIN taxonomy
- Archive Template being used instead of Category Template for Custom Post Type
- List of a specific Custom Post Type in Custom Template
- Display Posts Query with IF function
- Require custom post type if is_admin() – template doesn’t show up?
- Custom post types templates
- Shortcode in pages or tempate files for custom post type
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- Add custom template ‘sub-page’ to Custom Post type?
- Load info from customposttype into template page
- custom post template design with dropdown option
- Custom post type single page uses the right template in preview mode but shows a different template after being posted
- Warning , Use of undefined constant PLUGIN_PATH?
- Post Attribute Section missing for Custom post type
- How do I force a CPT to select a shared custom template in Post Attributes?
- How to assign post to category
- custom post template not getting picked for posts with Unicode title
- Custom taxonomy with custom post type template not showing
- Custom taxonomy template for custom fields loop [closed]
- Values show up in custom home page but not in custom post pages
- How should i name the .php file to show custom posts under a taxonomy’s term?
- Organising custom taxonomies and custom post types
- Include template if a post is a single product
- Custom post type with two templates
- How to decouple custom post types components from template?
- Show Templates in Custom Post Type Editor
- template structure for CPT not clear
- Parent to another Custom Post Type – Template files not being recognized
- How to avoid hardcoded text in a custom page template?
- Load different template for CPT (in loop) in my plugin?
- Having some trouble properly displaying Custom Post Types in templates
- List a custom taxonomy’s terms, with links, on the taxonomy page
- query_post while (have post) get_template_part()?
- Using custom post types within a section of a template
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Problem retrieving custom field for a custom post type
- Only One Post of Custom Post Type Appearing on Template Page
- Choose custom post type template by category
- using a template for more then 1 page
- How can I produce multiple webpages with a different output based on one entry/Page/custom Page?