There are 2 possible ways to fix the issue with the term’s permalinks (which is currently using the wrong query var name – intvn-cat
):
-
Easy. Just set the 3rd parameter for
add_rewrite_tag()
tointervention_cat=
. I.e.add_rewrite_tag( '%intvn-cat%', '(.+)', 'intervention_cat=" );
-
This is what I would actually do – Remove the
add_rewrite_tag()
part in your code, then replace all of the%intvn-cat%
instances with%intervention_cat%
.
And then, be sure to flush the rewrite rules by simply visiting the permalink settings admin page.
Additionally, for performance reasons, functions like get_the_terms()
(which the results of has been cached), should be used. See https://developer.wordpress.org/reference/functions/wp_get_object_terms/#more-information.
Related Posts:
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- How to modify URL structures in custom post types and taxonomies or terms
- Archive page with multiple taxonomies rewrite
- Taxonomy archives based on Custom Post Type
- Permalink rewrite with custom post type and custom taxonomy
- Rewrite custom post type url’s adding meta box values
- WP Rewrite Rules – Custom post type & taxonomy
- Remove base slug in CPT & CT, use CT in permalink
- Custom Permalink Tag breaks Pagination
- Custom Permalink for Taxonimie and Custom Post Type
- how to get archive urls with same origin for custom types and terms?
- Permalink Structure CPT With Custom Taxonomy Fails
- Remove url rewrites for registered taxonomies
- Customize Custom Post Type URL
- How do I change the custom taxonomy slug to be the same as the custom post type slug?
- Custom taxonomy rewrite with query var returns %2F in URL
- WP Rewrite Rule Issue while using Custom post type & taxonomy
- Custom Permalinks with CPT and Hierarchical Taxonomies
- How to get list of taxonomy slugs ordered parents>childs?
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- WordPress custom permalink and archive link for custom post type
- How to rewrite the post slug of a custom post type post
- Modifying rewrite rules to use /category//
- Archive page for custom post type and custom taxonomy
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- Custom taxonomy and post type rewrite rules
- Remove cpt slug from url and use custom taxonomy instead breaks all other cpt
- How to properly set the rewrite rules for this case?
- Change CPT permalink to use the category
- How to fix 404 on post after prepending Custom Post Type url with Custom Taxonomy Term slug
- Redirect Custom Post Type from Child Taxonomies
- How to build overlapping custom post_type and taxonomy rewrites without conflicts?
- Custom Post Type rewrite url to /category/pagetitle [duplicate]
- page not found for example.com/custom-post-name
- redirect old post type url to new structure url
- Why won’t this rewrite rule work?
- Parent cpt/child custom post type URL permalink relationship
- Custom Taxonomy in Permalink from post type
- Custom archive URL as a subfolder of the custom post type slug
- How to work with URLs where sometimes a post or a subcategory is in the same part of the URL structure
- Remove date rewrite rule for custom post type archive page
- Custom post type yearly/ monthly archive permalinks
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- How can I rewrite URLs to pass taxonomy and post type values to the query?
- Adding meta values to permalink
- WordPress custom taxonomy URL rewrite on spelling errors
- How to check if last uri segment is a custom post type or taxonomy term?
- Hide child term posts on parent term pages
- Posts per Page on custom Taxonomy Template
- Display CPT taxonomies as an archive page
- Many to Many Taxonomies or rewrite rules?
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- How do I list terms of a custom taxonomy at i.e. domain.com/brands/
- Permalink Structure problem with cpt and custom taxonomy
- Custom Taxonomy 404
- Bulk 301 redirect for custom post type
- single-{post_type}.php is not loaded despite flushing rules
- Rewrite numeric ID parameter for hierarchical custom post type
- Adding the taxonomy before the custom post type
- Custom Post Type and Custom Taxonomy Permalinks
- Pagination problem
- Conditionally custom post type url rewrite
- Query var removed after rewrite
- Change Permalink Structure for Tag.php template
- Extending AZIndex plugin to use custom post types and custom taxonomies
- Display custom post type category, while in a CPT category, then the posts beneath
- How can I make the slug of the taxonomy also the slug of the custom post
- Hide or disallow default custom post type url?
- Custom taxonomy returns 404
- Pretty URLs and custom post types
- Specific routing for CPT
- Custom permalink with child taxonomy terms
- Custom post type archive with page as parent url
- Properly flush rewrite rules on plugin activation
- Custom Rewrite Rule for Custom Post Type with URL Param
- WordPress custom slug rewrite
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- Query Posts that have Custom Taxonomy
- Displaying custom taxonomy menu in custom post type archive
- Rewrite rules for custom post type
- Custom Post Type and Taxonomy Rewrite Error
- Url Rewriting a dynamic wordpress page with parameters
- Getting Same Description in All the Custom Taxonomy Posts
- pagination problem listing custom post types of taxonomy in wordpress
- Display CPT taxonomies as an archive page
- Set archive of custom post type like ‘posts’ page in reading settings is set
- Register post type getting error 404
- Customize url from the_terms
- Help with Multi Level Category Archive Page
- CPT url rewriting : regular posts return 404 error
- Pagination fault in custom post type archive page [duplicate]
- One custom post type with two different url structure base on taxonomy term
- title tag for custom post type remove taxonomy name from title tag
- Custom taxonomy archive page not routing?
- Custom Post Type Base URL
- 404 Error On Custom Taxonomy Pages 2, 3, etc
- Url rewrite with custom post type and taxonomy
- Two Permalinks with one Taxonomy (custom taxonomy) and (custom post type -> custom taxonomy)
- What is the best way to relate different custom post types?