You can load a different template for single posts via the single_template
filter. Just use the has_term()
function to check if the post has a specific term in your custom taxonomy.
function wpa_107626_single_template( $single_template ) {
// check if the post fits some condition
if ( has_term( 'term1', 'film_cat' ) ) {
$single_template = get_stylesheet_directory() . '/single-term1.php';
}
return $single_template;
}
add_filter( 'single_template', 'wpa_107626_single_template' ) ;
Related Posts:
- Taxonomy: Why ‘with_front’ => false DOES NOT WORK?
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Assign posts to taxonomy terms instead of the taxonomy terms to posts?
- Exclude from search all custom posts which are NOT in a taxonomy term
- Custom SQL Query on Custom Post Type. Order by Taxonomy?
- Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy
- Paginated Taxonomy Term Archive including one post per term
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Get posts by querying taxonomy and certain terms of the taxonomy?
- Custom post type templating problem
- Custom Post Type Taxonomy Filters
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- How to conditionally redirect to the post from a taxonomy page?
- How to group posts and get a mixed posts and groups view?
- How to list tags from custom post type attachments?
- How to get_term_meta on single custom post?
- I have custom post type with custom taxonomy. But not found the taxonomy page..
- How to List Custom Post Type Titles Based on Theirs Taxonomy Terms Inside a Nested Loop
- Custom Post type Query by Taxonomy
- How to display posttypes and taxonomy in standard posts, not in a separate label?
- ACF – Retrieve custom taxonomy from a relationship field
- Display Custom Field or Custom Taxonomy in front page /post/product
- WP_Query not using custom taxonomy categories on custom post type
- Showing taxonomies with terms that are attached to custom post
- Getting all custom post taxonomies and exhibiting only part of them
- Error get_posts with Custom Taxonomy and OR relation
- Get list of CPT posts in *current* post’s taxonomy term
- tax_query showing no results
- Linking custom taxonomies and posts
- Storing/querying custom date data
- Remove Custom Taxonomy Metabox from Custom Post Type Screen
- Get terms by taxonomy AND post_type
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Get Custom Taxonomy ID within loop
- Custom Post Types not showing on Custom Taxonomy archive page
- Remove Trash / Delete option for Custom Post Type / Taxonomy
- How to filter custom post types by custom category taxonomy
- Highlight menu item when on a custom post type?
- How to setup a Custom Taxonomy Term template
- Admin to user notices – best practices?
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Custom Taxonomy List links being re-written
- front end radio custom taxonomy with custom post type
- Limit taxonomy results to a single cpt
- Bulk 301 redirect for custom post type
- Associate Taxonomies Across Post Types
- ‘category__and’ for custom taxonomy?
- Custom post query by taxonomy
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Sharing a custom taxonomy with Multiple custom post types
- Show Two custom Post type and their posts on category page
- Group custom posts by custom taxonomy names
- Change Permalink Structure for Tag.php template
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- Get post from custom post type order by two taxonomies
- How to convert custom post type based list to a dropdown list?
- Custom Taxonomy Archives on Custom Post type Page [duplicate]
- How can I make the slug of the taxonomy also the slug of the custom post
- Listing posts under primary and secondary taxonomies
- How do I display the grand child items of a taxonomy term?
- Is it better to use WordPress Custom Post Types or Taxonomies?
- Search by tag name and category
- Query posts with double taxonomy
- get_the_title() is returning results from previous loop
- How do I display a list showing custom post types nested within a taxonomy?
- Creating two loops based on different logic
- get_category_link() for custom post type does not include custom slug rewrite?
- How to show all taxonomies within custom post type loop
- Showing taxonomy terms on custom post type
- Custom Search | check multiple meta_value for search value
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- How to list custom post types on a custom post type page?
- Using WP_Query, I want to show posts that are associated with a custom taxonomy term
- Foreach loop returning more than one item when querying taxonomy
- Check when the post type changes, and display content
- Loop and add Specific Categories and Products Images
- custom post archive URL is wrong
- Custom Post Type with Different Sets of Post Content?
- Add a class to a div if custom post type has specific terms?
- Custom post type paging return home page
- In child theme, add CPT to custom taxonomy registered in parent theme
- Custom taxonomies not displaying in some custom posts
- Custom taxonomy returns 404 even with saving permalinks
- Static Front Page not working for custom theme
- WP_Query to display number of custom post type filtered (order by) taxonomy
- Custom post type shortcode with taxonomy attribute not working and no errors
- Live search by custom tag
- Set a Default CPT taxonomy by taxonomy id
- Custom taxonomy terms registered not showing when added in child theme
- Custom post edit page permalink links to edit page rather than the post
- Not Able to List CPT Based on Taxonomy Term
- Show tags of custom post types in WordPress
- Display all Custom taxonomy terms and their relevant custom posts
- Best way to group posts based on custom post type terms
- Render custom taxonomy query as single template
- Custom meta-box for all custom post types
- Remove custom taxonomy ‘post-type’ from post URL
- Custom My account page and custom page for editing posts
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Require Custom Taxonomy for Custom Type