This one has tripped me up in the past. If you have a collision between a taxonomy and post type rewrite, it’s important that you register the taxonomy before the post type.
Assuming you’d be ok with reworking your reviews URLs to the format /reviews/%niche%/%postname%, you’d need to change your post type as follows:
'rewrite' => array( 'slug' => 'reviews/%niche%', 'with_front' => false ),
'has_archive' => 'reviews',
your taxonomy:
'rewrite' => array( 'slug' => 'reviews', 'with_front' => false ),
and as mentioned above, do your call to register_taxonomy()
before your call to register_post_type()
. Visit Settings > Permalinks and resave to flush your rewrite rules.
Related Posts:
- Get Posts Under Custom Taxonomy
- Displaying the category name of a custom post type
- Show WordPress Custom Taxonomy Items Based On a Selected Item From Another Custom Taxonomy
- Adding Multiple Values to a Post Meta Key
- How do I get the slug of a custom taxonomy category of a post?
- Remove custom posts that match taxonomy value
- Using Custom Posts with Metaboxes and Drop-downs
- How can I add a meta-box to the posts editor containing all items of a custom taxonomy as checkbox?
- Sidebar links for different pages
- Get posts by name and taxonomy term
- How to display data in archive page?
- Set terms in a custom post
- Get posts of ONE taxonomy term of custom post type
- Choose whether to automatically add a taxonomy with the same name as the post
- Posts list in custom taxonomy
- Get Posts Under Custom Taxonomy
- Duplicate Custom Post Type and Taxonomy Slug
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- How to allow visitors to filter posts by multiple taxonomies
- How do I insert a post with custom post type and relate it to a custom taxonomy?
- relating business and products with custom taxonomy?
- How To Use Custom Tax of a Post Type
- How to output all taxonomy links from a custom post type in a menu?
- How to associate a custom taxonomy to a post multiple times
- Show post count in custom taxonomy page
- How to get post count including nested categories
- Custom Taxonomy From Database
- Multiple Custom Post Type loop logic
- How to list all names and descriptions of a custom taxonomy
- 404 for some custom taxonomy not ALL taxonomy
- Multiple loops on a Search result page?
- Special Query: Title, Terms, Content – %LIKE%
- Taxonomy Category category.php not working
- Different post sort order within different categories
- Custom Post Types, slug, archive and SEO plugins
- Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?
- Elegant way to include only published posts with get_objects_in_term()?
- Using single.php from plugin folder instead of default template folder
- how to enable different number of revisions for different blogs when using WPMU?
- Showing current taxonomy terms
- Unattaching images from a post
- Post from front-end only by logged in users, form posts as “posted by:
- automatically create taxonomy with same name as post title
- Allow role to delete posts but block him the wp-admin
- deleting terms programmatically
- Removing the “Popular Terms” area from the Taxonomy Edit Screen in the Admin Area
- How to show featured image in custom post type dashboard post page
- Posts vs. Pages
- Dynamic carousel on individual posts
- How to add pagination in between post and comments?
- Pass data between pages
- Print all the tags from a custom post type Please
- Display multiple custom taxonomy values on single custom post types page?
- Custom loop pagination links not working
- wp-cli post create & media import issues
- Search results posts_orderby and ID
- How to render taxonomy in loop of custom post_type
- Getting value from get_post_custom
- Set Default Category to Username
- How to add tags (custom taxonomy) to post class css?
- show custom post type category dropdown sorting result on same page
- Dynamically switch template on click
- outputting posts’ taxonomies: cant get ‘get_the_taxonomies’ working
- Displaying posts that belong to a specific author
- Get posts and include taxonomy term
- Tell WP to use a specific template file in posts
- Two Custom Post Types with Identical Articles Competing for the same Slug
- if in category but only with post meta
- Custom home page with full post for first one only
- Can WordPress handle following functionalities?
- Taxonomy Overview Page?
- Custom post type slideshow background images to insert in a plugin
- Trying to exclude custom posts based on date, while sorting by custom field
- Hook save_post_cpt not triggered when custom fields are modified
- Alt text attributes not showing over portfolio images
- Adding an option to post editor to show a site disclaimer or message
- Added a ACF field to custom page and want the results to show as a column in admin
- WordPress Pods Custom Post Type – separate Media Upload folder for each custom Post Types
- Taxonomy checkboxes not showing current status on edit page
- Template for displaying CPT / Taxonomy URL issues
- Put page on Archived statut after end of publication date
- Loop through taxonomies and loop through their terms (Newbie question)
- Hiding title of selected post without plugins
- How to get meta data from custom category name
- Add Categories To Custom Post
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- how to redirect page after delete post inside a post page?
- Permalink base only for posts
- issue in wordpress auto delete post and redirect to another 1
- Custom Single Post Type not referring to single-post-type.php File
- “Current” class on a singular page menu item with custom post types?
- Successive creation of over 1000 posts causes 404?
- Choose options via url
- Custom Post Type Pagination 404 Error (if paged>=2) [duplicate]
- retrieve post slug by post_tags taxonomy
- Display ONLY Latest Post From Several Categories
- custom post type single page template not working
- Display post structure in function
- Default post type doesn’t display in url
- Need to show birthday of custom post type(Famous people in this case) in elementor. Date of birth set in custom fields