Well one approach would be to create a generic single-media.php
file and put a condition inside it which checks for the specific taxonomy. Then you would be able to include the other two based on the condition.
So, create the main template – single-media.php
and the other two templates page-media.php
and page-music-library.php
. Then you could check for the the specific
taxonomy in this file and include the corresponding file based on the condition.
a simple example of single-media.php
would be
<?php
/*
Template Name: Single Media
Template Post Type: post, media
*/
//header and stuff
if ( has_term( $term, $taxonomy, $post ) ) {
include '{path}/page-music-library.php';
else {
include '{path}/page-media.php' ;
}
Related Posts:
- What is singular.php?
- Custom Post Type Specific Post Template
- WordPress giving me the index
- How to disable the single view for a custom post type?
- Custom post type single page returns 404 error
- Custom post type single-{custom}.php not working
- Conditional for single-{post-type}.php
- What are the differences between custom post type and custom page templates?
- Page Template as Custom Post Type Archive
- Setting a custom sub-path for blog without using pages?
- Template for specific post of custom post type
- Add Content to Page without shortcodes
- Single custom post type page redirecting to 404 page
- Loading custom page template via plugin
- Post formats “audio” and “video” only showing in index.php
- Ordering Posts List By Taxonomy Terms?
- Creating a Custom Post Type for Inserting Preset Content into Post & Pages?
- WordPress keeps fetching the archive page instead of the template page
- Pre get posts for single post
- Pull Two Posts Into Custom Post Type `single-cpt.php`
- How to add custom template in plugin?
- is_singular() not working if called via callback function of admin-ajax.php
- How to quickly switch custom post type singular template?
- Disable Single Post View for Specific Taxonomy on Custom Post Type
- Add a Template to a custom post type
- How to use a dedicated template for the Custom Post Type from a plugin?
- WordPress calls archive page instead of Custom Page Template
- How do I Make a custom post type get a custom post template in a plugin
- How to sort list of custom posts to get view like a tree of posts under categories and their children’s categories?
- Assign Page Template Within A Custom Post Type
- Dynamic page.php template for custom post types
- Custom post type archive and single.php files not working
- How to get a list of term names of the custom post type im currently on in single.php
- is_singular won’t call my functions?
- Page Templates – this code only works for one Custom Post Type
- Create sub single pages
- Pagination on a custom page template
- Using previous_post_link and next_post_link to wrap around post sequence
- Custom Post Type – Archive page title
- How do I create new content pages for my Custom Post Type?
- WordPress custom post type Single.php?
- Multiple templates for custom post type
- Display “Post 2 of 4” on single post page?
- posts_nav_link on single post template
- How do I create a custom post type for a training CMS in WordPress?
- Post Rank on Single Post page based on custom field
- Disable single pages and archives and keep preview
- Displaying Meta Box Image
- Custom Post Types, Page Templates and Pagination. Why do I get a 404 Error?
- How do I create a page template to display a custom post type?
- Custom template for post type not working
- How to make an archive page displaying posts in a date range
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Make custom post type display as a page
- Custom Post Type slug same as page name causing a conflict
- Control Custom Post Type template from a plugin
- Detect if 1st, 2nd or 3rd level custom page?
- Create second custom 404 page for selected post type
- is_page_template not working as expected
- Child page in custom post throws 404 page not found
- CPT: archive-cpt.php VS custom page template
- Multiple portfolios with one custom post type?
- Take Variables Set in Functions.php and Echo Them Inside My Custom Post Template
- Hyphens instead of Underscores in Post-type Archive Template Filenames when Post-type handle contains underscore
- Disable single view in register_post_type [duplicate]
- Including Custom Post Type posts in a page template contextually (or should I widget?)
- Help with CPT template pagination
- Custom Blog Post Listing in Genesis Sample Child Theme
- After updating a page, all pages on the site used the index.php template
- Archive page for custom post type not working
- Redirect Single Post CPT (Custom Post Type) to a specific URL
- Need post_type_archive_title function but in ‘single’
- Page Templates Drop Down Select for Custom Post Types
- Pull in custom content types into page template
- Editable content on a Custom Archive page
- Using custom page templates with plugin [duplicate]
- pagination redirecting from page number url before page requested
- Can I make WordPress use a custom template for a child page
- Troubles with making a custom template for posts
- How to check the terms in single custom post type template
- How to show the archive / post type description on Single templates
- Need to display same custom post type on 2 different singles templates
- Made Custom Post Types, but single.php not working
- Posts of custom post type load the page template
- How to call custom single post?
- Custom post template for particular posts
- Create Template for Custom Post Type same like for Page
- Creating a Page to View the List of Posts for a Custom Post Type?
- How to load a template without it being assigned to a page/post?
- Change archive page template using pre_get_post
- Custom template with CPT doesn’t display on frontend
- Remove single page for custom post type
- Single Template that can be applied only via URL
- Custom Page that comes with preloaded content for the user
- How do I display tags for a custom post type single page?
- create a template page for a post
- Custom post type archive page template
- Custom Post Type with Templates using Meta Boxes?
- Posts are duplicating on wp_post_update
- Custom-Posttype & Custom Taxonomy WP_Query