You may want to look at the TwentySixteen theme, which does it this way:
In single.php
:
get_template_part( 'template-parts/content', 'single' );
Several templates are grouped in the ‘template-parts’ folder. You could use a similar logic for your custom post type.
It seems that the technique comes from _underscores.
Related Posts:
- Why is get_post_format() for “Standard” returns empty
- Password-protect a custom rss feed
- Get term name and term parent into custom post type permalink
- How to produce a sub-page-system in WordPress
- Specify a particular page to list all custom types
- Template Hierarchy for custom post type pages
- Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?
- Methods for development wordpress themes [closed]
- Custom Post Type – Main page for certain posts
- erase post excerpt limitation [×]
- Query custom post type and showing its content
- Create custom post order (with custom post type meta)
- Change position of Post Formats box?
- How to manage wordpress knowledge base/wiki/posts collections
- REQUIRED: The theme uses the register_post_type() function, which is plugin-territory
- Custom Post Type Templates from Plugin Folder?
- How to move page template files like page-{slug}.php to a sub-directory?
- Change permalinks for posts but not for custom post types
- What WP folder can I use to write files to?
- Assign single template to multiple custom post types?
- How to build a complex page structure
- How to set a fall back template for a custom post type in a plugin?
- How can I fix those issues generated by the Themecheck plugin
- Rename a current used post type
- How to override parent theme function through the child theme [closed]
- Template tags to display custom post type posts in category template?
- single-type.php not working, delivering 404
- Single Page WordPress CSS and JS links
- Want to turn WordPress into a paid subscription directory
- adding .current* tags to custom post types and taxonomies
- How do I create an archive page for standard posts?
- Custom post types with custom directories
- I am trying to output portfolio items with a picture. This code doesn’t seem to be working. What am I doing wrong?
- Remove parent from custom post type
- Page as a child of a Custom Post Type
- Pre_get_posts filter overwrites all search functionality
- Displaying a custom post types custom taxonomy value?
- Should I use custom menu, C.P.T. or theme options, or something else for this?
- What template files do I need to customise custom-category-term-links rather than fall back on archive.php?
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Query & Order posts by custom fields
- custom taxonamy and post type
- Not Able to Get Custom Post Type Gallery Images URL
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Building a Treatments Page, What Do I Use?
- Migrating a taxonomy’s tags to the native category
- Adding custom image sizes and post types to a plugin or to a theme?
- How to specify a template for a path like http://example.com/something?
- Unable to set featured image
- uploading problem of wordpress theme
- Two column layout with alphabetical ordering
- Api rest_route 404 while building filter for custom posts (filtered by multiple meta keys / custom fields)
- how to get this tax_query working?
- why post_class() function apply css classes to all other files?
- How to add a sub directory to WordPress single posts without affecting other post types?
- Custom post type’s posts are not showing anywere but in xml sitemap
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Create a simple Testimonial page
- Assign a template to a custom post type when displayed by the main loop on the home page
- One Site. One Theme. Multiple Stylesheets without plugins?
- Custom Post Type – Portfolio no longer works
- If Post type use sidebar (‘tree’)
- How do I include a partial from a directory below a wordpress theme directory?
- Having Issue on Getting Metabox Checkbox Value
- Custom meta box in custom post type not working
- Custom post type posts wont show in wp_nav_menu()
- Yelp-style geographic directory plugin?
- How can I tell if I’m on a custom post type archive page?
- Front end create custom post types
- How to Enable Ascending or Descending In WordPress Default Built-in Loop
- How to display posts from a certain category in a bootstrap 5 carousel loop with multiple items?
- Invalid content when I try to import custom post type from the old template wordpress
- How to get the custom post data using post id in WordPress?
- Loop all post on single.php
- How can I make reusable post types with complex custom field structures?
- Custom post type 404 category page
- How to search through all child taxonomies using WP_Query?
- programmatically generated custom post type is created more than once
- How to use posts as tabs in a custom page?
- Custom Post Taxonomy Template Not Loading Properly
- Problem with multi checkboxes value in metabox?
- Create dynamic logo carousel without using any plugin
- call a function when insert and update a custom post type
- Change Background Color For CPT Template
- WordPress add taxonomies/terms list as a menu in archive page
- How To Display Category list from Portfolio post type plugin?
- Adding CPT changes entire layout of my site except for the archive of that CPT
- getting a blank login page :( any way I can fix this without having to do a clean install?
- Search form to find custom meta box generated data
- How to get $post object available inside functions.php to localize script?
- How to Display CPT Posts on index Page
- Issue on Counting CPT’s Under Taxonomy Term
- Why is my custom form saving with ‘autodraft’ as title and slug?
- Author profile comments system
- Custom post type and custom taxonomy archive inaccessible
- Query by post type or category
- Apply custom names for generic custom taxonomy name?
- Category names on CPT archive pages [closed]
- How to create custom page templates with default page layout framework?
- Can you programme the selected page template to display block patterns automatically?