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
- Adding Category to Child Posts Permalink
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- get_posts assigned to a specific custom taxonomy term, and not the term’s children
- Get the the top-level parent of a custom taxonomy term
- Custom taxonomy, get_the_terms, listing in order of parent > child
- Custom Post Type Permalink / Rewrite not working immediately
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Custom Taxonomy Endpoint Pagination using paginate_links()
- Determine Term depth
- Custom taxonomy listing page when no term set (all terms)
- Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT
- How to modify URL structures in custom post types and taxonomies or terms
- Help with a TV series Rewrite structure
- Get taxonomy name of current post
- Custom taxonomies, with custom rewrites/slug, AND loading a taxonomy archive template from a plugin
- Determine if Term has Grandparent/Great-Grandparent
- Permalink rewrite with custom post type and custom taxonomy
- Remove Custom Taxonomy Base
- Custom Taxonomy Relationship (ex: plant classification)
- Custom Taxonomy Only Showing Top Level Terms in Admin?
- How can I set up a category “overview” page?
- Nice URLs for a Custom Post Type List with a Shared Custom Taxonomy?
- Dynamic page slug for Custom Taxonomies?
- 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
- Pros and cons of using [taxonomy name] in place of [category name]?
- 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
- Hierarchical display of custom taxonomy
- Change in custom taxonomy permalink causes 404 error for another custom taxonomy
- Taxonomy based permalinks
- Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
- custom taxonomy archive permalink shows 404 error
- 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
- Populating dropdown menu with hierarchical taxonomies
- Custom Permalink Tag breaks Pagination
- Taxonomies: display hierarchical parent list
- Custom Permalink for Taxonimie and Custom Post Type
- How do I get WordPress URL rewrites into Sitemap?
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- 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
- Display hierarchical subterms of custom taxonomy based on depth
- Permalink Structure CPT With Custom Taxonomy Fails
- Parent & Child Taxonomy slugs in custom post permalink
- Permalinks for custom taxonomy stopped to work
- Date archive permalinks for custom taxonomy
- Taxonomy with_front causes all
- Redirect all child taxonomy to its parent
- 404 error- issues with pages after adding custom rules for posts
- How to overwrite registered taxonomy url from vendor plugin in child theme
- How do I display a list of posts under all hierarchical children of the current taxonomy?
- How to add a Rewrite Rule / Category Structure
- Register a pre defined tree of taxonomies
- 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 to make custom post taxonomy looks like regular categories?
- Replace taxonomy permalinks
- Custom Taxonomy and Rewrite URL
- How do I create a permalink structure with 2 taxonomies
- Base permalink for custom taxonomy
- Hierarchical Taxonomy Terms Select Menu Output with selected=”selected” Set
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- Hierarchical permalinks for custom post type and taxonomy
- 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?
- Custom post type Permalinks with hierarchical Taxonomies