What you would do, is have your default single-article.php
. This will get called by default because of the WP permalinks and templating system.
At the top of your single-article.php
do the following before your get_header()
call:
<?php
$language = get_the_terms( get_the_ID(), 'language' );
if ( ! is_wp_error( $language) && $language && 'French' == $language[0]->name ) {
get_template_part( 'single-article-french' );
} else {
// english template stuff
get_header();
// etc.
}
That way you will call single-article-french.php
when the French category is selected.
Related Posts:
- Taxonomy, Terms, and Template Files
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Templates for Custom Post Types and Custom Taxonomies
- Get page by template?
- Custom taxonomy query for a custom post type
- Need some templating advice for templating with custom post types and taxonomies
- Custom Post Type with Nested Taxonomy and Template Files
- Custom Post Type Archive Template
- custom post type archive template per custom taxonomy term
- custom taxonomy – Template not working
- Include different loop templates in search query
- Create separate template for shared custom taxonomy with shared terms
- Trying to manage templates on a blog with lots of custom taxonomies
- How do I provide a “show all posts” link in a paginated term archive?
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Query with no terms uses index.php template instead of archive.php
- Create template for taxonomy results limited by Custom Post Type
- Template for custom post with custom taxonomy
- Custom taxonomy and custom post type – wrong permalinks and template
- WordPress Doesn’t Generate Taxonomy Archive
- Custom taxonomy returns 404
- Template for all categories of a custom post type?
- Migrating a taxonomy’s tags to the native category
- WordPress custom taxonomy template not working
- How can I get this request to use the Custom Post Type page template instead?
- Archive for a Taxonomy of a Custom Post type
- Template files for Custom Post Type and Taxonomy
- Main query not querying any posts in custom taxonomy template
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- Which file/template is in charge of taxonomies for custom post types?
- How to get_term_meta on single custom post?
- Get template part with CPT and Custom Taxonomy conditionals
- How to create a template to show child terms of a MAIN taxonomy
- Create a custom taxonomy template that loops through child categories in term order?
- Post template with breadcrumb needs to show page navigated from
- Custom Post Taxonomy Template Not Loading Properly
- taxonomy – templates are not loading
- Custom taxonomy with custom post type template not showing
- Custom taxonomy template for custom fields loop [closed]
- Templates for CPT not working
- Single taxonomy for different custom post types
- How should i name the .php file to show custom posts under a taxonomy’s term?
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Custom Post Type tag taxonomy “Page Not Found”
- template structure for CPT not clear
- WordPress Custom taxonomy template
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Querying multiple taxonomies in URL leads to wrong taxonomy archive
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Most appropriate way to display CPT’s by children terms of custom taxonomies while retaining desired permalink structure?
- Only One Post of Custom Post Type Appearing on Template Page
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Shouldn’t this be easy?! Custom post type/custom taxonomy permalink
- Combining Multiple Taxonomies in one URL
- Getting the Intersection of Two Custom Taxonomy Terms for a Custom Post Type?
- ‘No pages found’ in Dashboard after registering custom taxonomy
- How to display recent posts added in custom post types
- Creating a function that receives the taxonomy terms that have been changed in a custom post type
- Permalinks when filtering multiple custom post types by single taxonomy
- Filter custom post type archive page with custom taxonomies (categories) with AJAX
- How can I filter by taxonomy on a custom post type’s page?
- Loop custom taxonomy to get lists of cutom post types?
- Conditional Query of Custom Post Type and custom taxonomy
- Getting template_include to work when allow_url_include is off?
- Is $object_type truly required with register_taxonomy()?
- Show a Category X’s custom post type on Category X archive page?
- Suggested Post and Taxonomy structure
- Display post content with respect to its title?
- Use custom walker to add taxonomy terms to main nav menu
- WP_Query orderby and tax_query
- Creating custom post type with custom taxonomy and custom fields programatically
- How to get only child terms from a custom taxonomy of current post type?
- How to see posts in taxonomy endpoint
- Get taxonomy singular name instead of taxonomy slug inside $taxonomy query
- Cannot choose custom categories for custom post type in post editor
- Different structure/content for posts from a custom post type
- Custom Post Type URL Rewrite’s
- Add term for custom taxonomy from front end
- Custom post type draft use wrong template
- Custom Taxonomy Filter Issues
- how to organize my categories or should I do custom post types for some?
- How do i display post from a taxonomy term?
- How do I make a request in my browser to search the CPT taxonomy?
- Archive page of taxonomy returns a 404 error
- Get dropdown child categories from parent category of custom post type
- How do you create pillar content pages?
- I want to create a metabox under custom taxonomy
- Set different posts_per_page for custom post type/taxonomy
- Creating adminable dynamic filtering on custom post type
- Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
- WP_Query for CPT with filter by another WP_Query
- Get posts in same category not working
- Heirarchical URLs with CPT and custom taxonomy
- Permalinks when using Custom Post Type with static page for archive
- How to change permalinks to taxonomy and post type’s posts
- Query Only Show Text on Posts With Certain Taxonomy Tag
- How to make a single Menu Item call another Mega Menu for Custom Post Types and Custom Taxonomies?
- How to make a template for a specific post of a custom post type?
- Custom Post Type urls not working
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu