I solved this issue by the following codes where you need to define “rewrite” argument as follows
register_taxonomy( 'map_categories', 'map', array( 'hierarchical' => true, 'label' => 'Catégories', 'query_var' => true, 'rewrite' => array('slug'=>'commerce/artisans','with_front'=>false, 'hierarchical' => true) ) );
You need to understand that ‘hierarchical’ in rewrite actually solve your purpose.
After the update in codes you need to save your permalink structure again. 🙂
Related Posts:
- Custom Post Type – Main page for certain posts
- Change permalinks for posts but not for custom post types
- Custom Post Type Permalink Page Not Found
- Why is get_post_format() for “Standard” returns empty
- Password-protect a custom rss feed
- single-type.php not working, delivering 404
- Is it possible to place custom post type files inside a folder in theme directory?
- How to have this permalink structure: post_type/postname/custom_inner_page
- Specify a particular page to list all custom types
- How to have permalink like domain.com/term/postname?
- Custom post type permalink sends to 404.php
- Template Hierarchy for custom post type pages
- Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?
- Methods for development wordpress themes [closed]
- Error 404 change permalink term custom term taxonomy
- Links Image in “Catalog” Page to Posts
- erase post excerpt limitation [×]
- Query custom post type and showing its content
- Create custom post order (with custom post type meta)
- Change position of Post Formats box?
- How to manage wordpress knowledge base/wiki/posts collections
- REQUIRED: The theme uses the register_post_type() function, which is plugin-territory
- custom permalinks based on taxonomies for custom post type
- Why does wordpress keep adding postname to my CPT’s permalink in the end?
- Custom template with CPT doesn’t display on frontend
- post_type_link not working in gutenberg
- Wrong generated page_name/slug on first publish of custom post type
- Remove post type slug of all post types from permalinks
- Custom template won’t load for a custom post type (custom permalinks used)
- Making a custom help center page
- Stop / prevent WordPress from updating permalinks of custom post type
- What’s the difference between same wp functions get_posts(); functions in different form?
- Custom taxonomy in URL showing 404
- One-to-many post relationships that are displayed by category (using posts-to-posts plugin)
- Custom post type and permalink issue
- How do I correct an incorrect permalink?
- How can I update the permalink everywhere for a custom post type?
- Update permalinks when new category added to custom post type taxonomy
- Create a wordpress test-system as a clone from productive system
- Add archive slug to default post post type
- Custom Post type and permalink settings
- What template files do I need to customise custom-category-term-links rather than fall back on archive.php?
- Custom rewrite rule for hierarchical custom post type
- Tag Archive for Custom-Post-Type Posts yielding 404 when permalinks set to postname
- add category name to permalinks on product page /category-name/product-name
- Use menus with anchors
- Custom Post Type permalink shows wrong page: homepage/index.php
- WordPress add_permastruct unwanted matches
- Rewrite rules for custom posts types
- Permalink structure by Post Meta value
- Does WordPress consider a post name unique if that same post name is in multiple Post Types?
- Why doesn’t a custom post type permalink ever hit index.php
- Allow non-logged in users to see a future post after clicking on a list of future posts
- How to hook custom taxonomies to custom post types and make the permalinks work?
- custom post type parsed as attachment
- Help need making decision. Ads rotating site on wordpress
- Query & Order posts by custom fields
- 404 Issue w/ Custom Post Type – using Meta for Permalink rewrite
- WordPress Custom Post Type Repeated 404 Errors
- custom taxonamy and post type
- Child post with numeric only slug keeps redirecting to parent
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- How to change custom post type permalink structure
- Custom post type url with category
- Help with Elementor Pagination CPT archive 404 problem
- Adding custom post category slug in permalink causes 404 error for pages and posts
- How can I use get_post_meta with add_rewrite_rule to build custom permalinks?
- Allow post/page hierarchy across different post types?
- Permalink for a custom post type isn’t working and I don’t know why
- Return the latest post from a custom Taxonomy and Post Type
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- Don’t know how to show custom taxonomies from a custom post_type
- Add custom post type settings to wordress default posts
- How Can I Change the Custom Post Type Slug to the Taxonomy Slug in the URL?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- WordPress Custom Post Type Permalinks dynamic term slugs
- 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?
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- custom-taxonomy/post_name instead of the default post_type/post_name
- Show custom post archive when custom post not specified
- Show custom post type relationships by taxonomy
- Not Able to Get Custom Post Type Gallery Images URL
- JS innerhtml changing style when using AJAX
- Assign same parrent Page to pages AND custom post types
- Can’t remove front from permalinks for custom taxonomy category page
- WordPress custom post type permalink rewrite shows page not found
- How to set a CPT to have a page as a parent, then rewrite urls accordingly?
- Completely remove custom post type permalinks (“One Page” website)
- Using taxonomy term in CPT permalink – Pages 404’s
- Display a grid of taxonomy terms at root taxonomy page
- Removing custom post type slug from URL
- How to add rewrite rule to custom post type with parent in url with cpt ui?
- Custom post type as home page with custom url
- Customize Custom Post Type URL
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- How to change the post type a theme shows by default?
- Get unique superset of taxonomy terms from a list of custom posts in another hierarchical taxonomy
- Create a custom php page and load it at a specific slug