These types of URLs are supported since WP 3.1:
register_taxonomy( 'types', 'post', array(
'hierarchical' => true,
'rewrite' => array( 'hierarchical' => true ),
...
);
Remember to flush the rewrite rules after making the change.
The template you would use for both parent and child terms is taxonomy-types.php:
$current_term = get_queried_object();
if ( 0 == $current_term->parent ) {
// it's a parent term; display it's child terms using wp_list_categories() etc.
} else {
// it's a child term; display the posts using The Loop etc.
}
Related Posts:
- Templates for Custom Post Types and Custom Taxonomies
- Custom Post Type with Nested Taxonomy and Template Files
- Custom taxonomy returns 404
- Template files for Custom Post Type and Taxonomy
- Rewriting a custom-post-type permalink with taxonomy term?
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Remove slug in taxonomy url
- Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT
- custom post type and custom taxonomy permalink
- Is there a way to use regular categories with custom post types?
- Get page by template?
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- Custom taxonomy query for a custom post type
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Rewrite permalinks for custom posttype and custom taxonomy
- How to check if last uri segment is a custom post type or taxonomy term?
- Custom Post Type Archive Template
- Custom permalinks – post type – hierarchical taxonomy’s
- Custom taxonomy & post slug permalink
- Including two taxonomies in a permalink structure
- WP Rewrite Rules – Custom post type & taxonomy
- Remove base slug in CPT & CT, use CT in permalink
- Permalink Structure problem with cpt and custom taxonomy
- Clean URL permalink for custom post type
- Custom Taxonomy List links being re-written
- custom taxonomy – Template not working
- Custom Post Types, Custom Taxonomies and Permalinks ?
- Custom post type permalinks giving 404s
- Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
- Create separate template for shared custom taxonomy with shared terms
- Add the .html extension to custom post types
- Trying to manage templates on a blog with lots of custom taxonomies
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- Custom Permalink Tag breaks Pagination
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Custom Permalink for Taxonimie and Custom Post Type
- Custom Taxonomy breaking pages permalinks
- removing custom tax & CPT slug, adding taxonomy term in front of custom type
- Custom post type and taxonomy permalinks – Structure
- Custom Post Type and Custom Taxonomy Permalinks
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- Custom post types and permalinks
- Permalink Structure CPT With Custom Taxonomy Fails
- Change Permalink Structure for Tag.php template
- Use different taxonomies in different custom post types’ permalinks?
- Custom template won’t load for a custom post type (custom permalinks used)
- How to hook custom taxonomies to custom post types and make the permalinks work?
- How to have the same url structure for both a CPT and a Taxonomy?
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- Custom taxonomy and custom post type – wrong permalinks and template
- Can’t remove front from permalinks for custom taxonomy category page
- Removing custom post type slug from URL
- Customize Custom Post Type URL
- Custom Permalinks with CPT and Hierarchical Taxonomies
- How to have this permalink structure: post_type/postname/custom_inner_page
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- Custom post type, permalinks, taxonomies and blog posts
- permalink /category/post-name with custom post type and taxonomy
- Flush Rewrite Rules when new site is created on network
- Custom permalink with child taxonomy terms
- Custom post type Permalinks with hierarchical Taxonomies
- How can I get this request to use the Custom Post Type page template instead?
- Archive for a Taxonomy of a Custom Post type
- How to solve this custom post type goes to 404 page?
- Main query not querying any posts in custom taxonomy template
- Can’t use pagination with custom taxonomy
- make permalink go to a custom single.php file
- Which file/template is in charge of taxonomies for custom post types?
- How to get all posts related to particular category name on button click?
- WordPress custom permalink and archive link for custom post type
- How to create a template to show child terms of a MAIN taxonomy
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Set priority to permalinks
- Changing CPT permalink
- How to change URL structure for custom post type in wordpress? Custom taxonomy + custom Post name [duplicate]
- Remove CPT Slug with 2 taxonomies and 1 post meta
- How to structure a website with custom post types and custom taxonomies?
- 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
- How should i name the .php file to show custom posts under a taxonomy’s term?
- Custom Post Type Taxonomy – Permalinks generating, but posts not found
- Custom taxonomy in custom post type archive with pagination
- template structure for CPT not clear
- Custom Post type and Taxonomy in post URL error
- How to retrieve the permalink for a specific (custom) term?
- Querying multiple taxonomies in URL leads to wrong taxonomy archive
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Permalink Trouble with Custom Post Type
- WordPress Custom Permalink Structure with Custom Post Type and Taxonomies
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Permalinks Works for Custompost type but not with pages Why?
- Problem with Custom Post Types, Taxonomy, permalink, Archive
- Only One Post of Custom Post Type Appearing on Template Page
- PHP Button Custom link [closed]
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- Two Permalinks with one Taxonomy (custom taxonomy) and (custom post type -> custom taxonomy)
- Modify permalink of CPT archive to support two taxonomies
- Have Custom Taxonomy Slug Fall Under Custom Post Type Slug