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
- How can I make the slug of the taxonomy also the slug of the custom post
- How to rewrite url for any specific taxonomy?
- Custom post URL 404 error
- Number of Custom Post Types published are not being shown in the custom page
- Remove slug in URL custom post type
- Rewrites/query for multiple hierarchical custom post types
- cpt and page sharing same base permalink
- WordPress uses url different from defined in rewrite arg of custom post type
- Hide or disallow default custom post type url?
- URL rewriting for CTP assigned entity
- Post Type rewrite rule to point to custom Page/template
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- Custom taxonomy returns 404
- Canonical url differs from custom post type archive URLs
- Including taxonomy term before post type breaks top level pages
- Correct procedure for advanced permalinks
- CPT’s with landing page instead of archive – Url Rewrite?
- posttype/taxonomy/term archive page 404 error
- Rewrite Endpoints and CPTs – How to use in a plugin
- add_rewrite_rule and passing variables for custom post types
- Pretty URLs and custom post types
- Get url.com/post_type/taxonomy/term work!
- Specific routing for CPT
- Ignoring slug capitalization on rewrite rule for custom post type archive page
- Taxonomy in URL
- Custom taxonomy and post type with same slug
- Different rewrite rules for taxonomies and cp in multisite?
- Custom permalink with child taxonomy terms
- Custom Post Archive is not working
- How to add custom taxonomy in custom post type permalink?
- Custom post type archive with page as parent url
- Add parent post to Custom Post Type [closed]
- Properly flush rewrite rules on plugin activation
- Best way to specify “article type” in URL
- What’s the name of the custom post type yearly archive template?
- Custom Rewrite Rule for Custom Post Type with URL Param
- WordPress custom slug rewrite
- Custom URLs in post types make it impossible to view archive
- I can’t access custom taxonomy page listing
- Alphabetically sort a taxonomy.php template by post title
- Custom Permalinks for Custom Post Types
- post_type_link Filter – Too Few Arguments
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- Custom Permalinks For CPT and pages with parent. Advanced WordPress
- Combine multiple CPT names to create valid permalinks
- Permalink problems with custom post type and custom taxonomy
- sort CPT on Custom Taxonomy Archive page
- SEO Concerns With Rewrite Rules
- Set parent for custom post type archive rewrite url
- Route subpage to Custom Post Type
- Add term slug in URL of custom post type details page
- Use the custom post type archive for taxonomies?
- Custom Post Type Advanced Slug
- Custom Post type date archive for custom taxonomy
- Show categories of custom post type and not all posts
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- rewriterule not working
- Urls in Custom Post Type work for Terms but not for its Taxonomies