Found the solution. By default wordpress doesn’t show hierarchical URL for custom taxonomies.
Therefore while registering custom taxonomy, we must include the rewrite variable.
$args = array(
'rewrite' => array( 'hierarchical' => true ),
);
Related Posts:
- Change URL structure of subcategory archive pages
- Change the full permalink (URL) of a single post by connecting it to a specific page
- Can’t get a custom template taxonomy page to display
- Custom taxonomy listing page when no term set (all terms)
- Removing taxonomy base using WP rewrite
- Custom taxonomy on permalink
- How to enable hierarchical permalinks for hierarchical taxonomies
- Remove Custom Taxonomy Base
- 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?
- How to fix a double slash in custom permalinks with hierarchical taxonomy’s?
- Getting archive pages in WP’s AJAX internal link finder?
- custom taxonomies on permalink
- Pros and cons of using [taxonomy name] in place of [category name]?
- Permalinks for quote authors
- Change in custom taxonomy permalink causes 404 error for another custom taxonomy
- Taxonomy based permalinks
- custom taxonomy archive permalink shows 404 error
- Custom taxonomy term in WooCommerce product permalink
- Add parent/child taxonomy to custom post type url
- Keep taxonomy base name in post permalinks
- How to create custom taxonomy URLs without taxonomy name?
- Change permalink of post if it belongs to custom taxonomy
- How to obtain the link/URL to the feed of a custom taxonomy?
- Permalinks for custom taxonomy stopped to work
- Date archive permalinks for custom taxonomy
- How to add a Rewrite Rule / Category Structure
- Get posts from taxonomy URL
- Custom permalinks with hierarchical taxonomy – getting PHP warning
- Change the permalink URL to include a taxonomy term
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- How to Rewrite Taxonomy URL to Include the Post Type as the Second Segment of the URL?
- How do I modify taxonomy term slugs dynamically?
- Permalink help with default Posts and custom Taxonomy
- Add Taxonomy Subcategory To Permalink
- how to change permalinks format for pagination?
- Replace taxonomy permalinks
- How do I create a permalink structure with 2 taxonomies
- Changing URLs for taxonomies and CPT
- Base permalink for custom taxonomy
- Rewrite Rules returning wrong data
- Adding custom taxonomy in my existing category URL
- Using custom taxonomies to display hierarchical URLs?
- How to change url for taxonomy pages?
- Query custom taxonomy by term id?
- Duplicate slug/permalink issue
- How to add hierarchical taxonomy with parent child relation to URL?
- How best to store data (URLs and IDs) extracted from posts and pages using custom taxonomies
- Clean Custom URL for Serach + Custom Taxonomy
- pagination not working on custom-taxonomy template
- WordPress modify Settings > Permalinks (options-permalink.php) Add CPT Permalink Options
- Double slash in the_terms URL
- How can I add a custom permalink to a term?
- Permalinks with custom taxonomies and regular categories
- Need equivalent of single_term_slug
- 404 Error on Custom Post Type / Custom Taxonomy
- How to define %category% for custom taxonomies?
- Custom Permalink Structure for terms/taxonomies of custom post type
- How to combine taxonomies into URL?
- How Can I Remove Child Slug From Grandchild Slug When Using Duplicate Grandchild Slugs?
- Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
- Taxonomy page loading wrong data
- How can I rewrite the URL of my custom taxonomy to include the year?
- How do I get the correct URL?
- Remove custom taxonomy slug from URL
- How to replace custom post type with custom taxonmy in permalinks
- Get taxonomy link with post type slug prefix
- How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?
- Restructuring permalink with more than one taxonomies
- Passing taxonomy id of taxonomy clicked on one page to another page
- Custom taxonomy return 404
- Permalinks incorrectly inserting multiple categories
- WordPress Taxonomy Permalinks – Custom?
- Need help understanding a rewrite with multi-level taxonomy
- How to make my taxonomy URL work?
- Broken paths on taxonomies after changing permalink to post name
- Custom taxonomy rewrite in permalinks for posts gives 404 on pages
- Permalink Rewrite to include Custom Taxonomy Term
- Multiple taxonomies, what should the permalink look like?
- Taxonomy to WordPress Permalinks of custom post type
- Where is defined a custom register_taxonomy? [closed]
- get multiple values from $_GET from multiple checkboxes
- Permalinks not working on MU network with domain mapping
- Hide custom post type slug url from search engine [closed]
- Optional taxonomy in cpt permalink
- post_type_link not working for posts without terms
- Child terms with improper parent in the url should redirect to 404
- Display one post from each term in a custom taxonomy [closed]
- Relative v.s. absolute URLs: which ones should I use for cross-domain portability?
- Output single post custom taxonomy child terms
- How to get custom category’s link?
- Post is blank when I click on the link
- search using multiple taxonomies and keyword
- wp_insert_post not adding taxonomy (using wp_set_object_terms)
- generate random slug when adding taxonomy
- Custom post type term names with ampersand in the term name
- Display custom post term or taxonomy
- Attaching meta box to specific category/taxonomy in custom post type
- Custom Taxonomy type in nav menu