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
- Custom post types, taxonomies, and permalinks
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- Permalinks: custom post type -> custom taxonomy -> post
- Mixing custom post type and taxonomy rewrite structures?
- Remove taxonomy slug from a custom hierarchical taxonomy permalink
- Rewriting a custom-post-type permalink with taxonomy term?
- Shouldn’t this be easy?! Custom post type/custom taxonomy permalink
- Custom Post Type Permalink / Rewrite not working immediately
- How do I append multiple taxonomies to the URL?
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Custom Post type & Taxonomy URL structure
- Remove slug in taxonomy url
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Combining Multiple Taxonomies in one URL
- Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT
- custom post type and custom taxonomy permalink
- Why does a custom post type need the ”hierarchical’ args setting?
- Is there a way to use regular categories with custom post types?
- Get page by template?
- How to modify URL structures in custom post types and taxonomies or terms
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- Custom taxonomy query for a custom post type
- Create permalink structure for one taxonomy archive per custom post type
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Help with a TV series Rewrite structure
- Custom permalinks
- array_pop() expects array, boolean given for $event_type_term ->slug
- Understanding Permalinks on Custom Post Types
- custom post type permalinks with category and tags
- Permalink rewrite with custom post type and custom taxonomy
- Add links to post categories and taxonomies in wysiwyg link modal?
- Need some templating advice for templating with custom post types and taxonomies
- Rewrite permalinks for custom posttype and custom taxonomy
- How to check if last uri segment is a custom post type or taxonomy term?
- Custom Permalinks for Custom Post Types and Taxonomies
- Custom Post Type Archive Template
- Custom permalinks – post type – hierarchical taxonomy’s
- Custom taxonomy & post slug permalink
- Semantic URL Custom Post Type and Taxonomies permalinks
- Including two taxonomies in a permalink structure
- WP Rewrite Rules – Custom post type & taxonomy
- Remove base slug in CPT & CT, use CT in permalink
- How to rewrite custom post type URL for multiple depths instead of one specific depth
- Maintaining WP_Query Relation Among CPT, Custom Taxonomy, Permalinks- CPT UI
- Custom post type category, taxonomy and URL rewrite problem
- Define permalinks for custom post type by taxonomy in WP 3.4
- Permalink Structure problem with cpt and custom taxonomy
- Clean URL permalink for custom post type
- custom post type archive template per custom taxonomy term
- Custom Taxonomy List links being re-written
- Remove taxonomy slug when not assigning taxonomy with custom post types
- custom taxonomy – Template not working
- Page to display an archive of taxonomies
- Custom Post Type: How to display all of same taxonomy?
- Custom Post Types, Custom Taxonomies and Permalinks ?
- How to create a permalink for custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- Include different loop templates in search query
- 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
- Remove “-2” from a Toolset Types URL with the same post name
- How to show custom taxonomy in the permalink?
- Add the .html extension to custom post types
- Trying to manage templates on a blog with lots of custom taxonomies
- Date-based permalinks for Custom Post Type, and custom taxonomy permalinks
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Custom Permalink Tag breaks Pagination
- Include taxonomy slug in url?
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Custom permalink – append taxonomy name and term name at the end of permalink
- How do I provide a “show all posts” link in a paginated term archive?
- Custom Permalink for Taxonimie and Custom Post Type
- Custom Taxonomy breaking pages permalinks
- Programmatically adding posts
- Permalinks for custom post-types within custom taxonomies not found
- custom post type and custom taxonomy url conflict
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- removing custom tax & CPT slug, adding taxonomy term in front of custom type
- multiple url slug for single custom post type
- Custom post type and taxonomy permalinks – Structure
- Add hierarchical taxonomy to permalink for custom post type
- Custom Post Type and Custom Taxonomy Permalinks
- Custom post types, taxonomies, and permalinks
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- How to specify URLS for custom posts & taxonomies
- Custom post types, taxonomies, and permalinks
- Custom post types and permalinks
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Permalinks not working for custom taxonomy on custom post type
- Permalink Structure CPT With Custom Taxonomy Fails
- Parent & Child Taxonomy slugs in custom post permalink
- Custom Post Types and independent Categories – complex Taxonomy
- Change Permalink Structure for Tag.php template
- Use different taxonomies in different custom post types’ permalinks?