This is implemented in WordPress now as of 3.1.
When you register your taxonomy, make sure to set rewrite hierarchical to true as well as the taxonomy itself:
<?php
register_taxonomy('genre',array('book'), array(
'hierarchical' => true, // this makes it hierarchical in the UI
'labels' => $labels,
'show_ui' => true,
'query_var' => true,
'rewrite' => array( 'hierarchical' => true ), // this makes hierarchical URLs
));
Related Posts:
- Can’t get a custom template taxonomy page to display
- Removing taxonomy base using WP rewrite
- Custom taxonomy on permalink
- How to check if last uri segment is a custom post type or taxonomy term?
- How to fix a double slash in custom permalinks with hierarchical taxonomy’s?
- Add parent/child taxonomy to custom post type url
- Custom permalinks with hierarchical taxonomy – getting PHP warning
- How do I modify taxonomy term slugs dynamically?
- Permalink help with default Posts and custom Taxonomy
- how to change permalinks format for pagination?
- Rewrite Rules returning wrong data
- Rewrite rules for varying nested terms of custom taxonomy
- How to change url for taxonomy pages?
- How do I get the correct URL?
- How to replace custom post type with custom taxonmy in permalinks
- Need help understanding a rewrite with multi-level taxonomy
- Get the the top-level parent of a custom taxonomy term
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Custom taxonomy listing page when no term set (all terms)
- Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT
- Help with a TV series Rewrite structure
- Determine if Term has Grandparent/Great-Grandparent
- Permalink rewrite with custom post type and custom taxonomy
- Custom Taxonomy Relationship (ex: plant classification)
- Custom Taxonomy Only Showing Top Level Terms in Admin?
- Custom permalinks – post type – hierarchical taxonomy’s
- Getting archive pages in WP’s AJAX internal link finder?
- Permalinks for WooCommerce Categories and Subcategories
- custom taxonomies on permalink
- WP Rewrite Rules – Custom post type & taxonomy
- Remove base slug in CPT & CT, use CT in permalink
- How to include parent terms in hierarchical taxonomy URLs?
- term_link() filter or rewrite and howto?
- WP redirects pretty permalink to query string
- How to set hierarchical terms to a post using wp_set_object_terms
- Help building array hierarchically with taxonomies (to get posts)
- Permalinks for quote authors
- Change in custom taxonomy permalink causes 404 error for another custom taxonomy
- Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
- Custom taxonomy term in WooCommerce product permalink
- How to get parents of custom taxonomy, as what get_category_parents() do?
- Change URL structure of subcategory archive pages
- Custom Permalink for Taxonimie and Custom Post Type
- Keep taxonomy base name in post permalinks
- Add hierarchical taxonomy to permalink for custom post type
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- Change permalink of post if it belongs to custom taxonomy
- Create multiple rewrite endpoints for custom taxonomy archive
- Permalink Structure CPT With Custom Taxonomy Fails
- Parent & Child Taxonomy slugs in custom post permalink
- Permalinks for custom taxonomy stopped to work
- Redirect all child taxonomy to its parent
- 404 error- issues with pages after adding custom rules for posts
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- Customize Custom Post Type URL
- Taxonomy Pagination Rewrite
- Custom Permalinks with CPT and Hierarchical Taxonomies
- How do I create a permalink structure with 2 taxonomies
- Custom Taxonomies not retaining hierarchy while importing from one site to another
- Rewrites with hierarchical taxonomies in permalink
- List Posts For Terms Of A Custom Taxonomy For Any Post Type
- Using custom taxonomies to display hierarchical URLs?
- Taxonomy Rewrite Rules Redirecting Instead of Masking
- tax_query: Don’t show posts with parent term when they have a corresponding child term applied
- Duplicate slug/permalink issue
- Display a specific hierarchical level of a specific custom taxonomy
- WordPress custom permalink and archive link for custom post type
- Ideas on how to organize a project [closed]
- How can I add a custom permalink to a term?
- Permalinks with custom taxonomies and regular categories
- Need equivalent of single_term_slug
- Rewrite Post URL so it is constructed from parent post url & child post url
- Change the full permalink (URL) of a single post by connecting it to a specific page
- Rewrite Search URL Permalink For CPT Custom Taxonomies
- How can I rewrite the URL of my custom taxonomy to include the year?
- How to change Custom Permalink for Taxonomy? (remove the slashes from term-slug)
- Remove custom taxonomy slug from URL
- True or F False Setting of ‘with_front’ Parameter of Rewrite Is returning Exact Same result
- Get taxonomy link with post type slug prefix
- Hierarchical taxonomies in permalink cause 404 for sub term archive
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Permalinks incorrectly inserting multiple categories
- Permalink structure not working with Custom Taxonomy (URL like ./taxonomy/category/postname)
- WordPress Taxonomy Permalinks – Custom?
- Broken paths on taxonomies after changing permalink to post name
- Permalink Rewrite to include Custom Taxonomy Term
- Multiple taxonomies, what should the permalink look like?
- taxonomy term names in custom post type permalink structure
- Determine if Term has Grandparent/Great-Grandparent
- Getting grandchildren of a post with a specified custom taxonomy?
- Adding rewrite rules to Custom Post-type mixed with Taxonomy
- New rewrite rules for custom taxonomy and reuse default
- Display Parent and child taxonomies in seperate drop downs [duplicate]
- More than one Hierarchical Taxonomy and SEO
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- Filter posts and custom taxonomy using add_rewrite_rule
- Two Permalinks with one Taxonomy (custom taxonomy) and (custom post type -> custom taxonomy)
- Optional taxonomy in cpt permalink
- Child terms with improper parent in the url should redirect to 404