I would do as @cfx suggested:
register_taxonomy( // Call before register_post_type() to give rewrite rule priority.
'bike_category', // Should be singular, not bikes_category
'bike',
array(
'rewrite' => array(
'with_front' => false, // This will strip the "blog" prefix
'slug' => 'bikes',
),
// Other args
)
);
register_post_type(
'bike', // Post type should be singular
array(
'has_archive' => 'bikes',
'rewrite' => array(
'with_front' => false, // This will strip the "blog" prefix
'slug' => 'bike',
),
// Other args
)
);
This will give you:
/bikes/
for global bikes archive (archive-bike.php
)/bikes/category
for a bikes category archive (taxonomy-bike_category.php
)/bike/bike-name
for a single bike (single-bike.php
)
Related Posts:
- Custom post types, taxonomies, and permalinks
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- Remove taxonomy slug from a custom hierarchical taxonomy permalink
- Shouldn’t this be easy?! Custom post type/custom taxonomy permalink
- Custom Post Type Permalink / Rewrite not working immediately
- How do I append multiple taxonomies to the URL?
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Custom Post type & Taxonomy URL structure
- Combining Multiple Taxonomies in one URL
- Why does a custom post type need the ”hierarchical’ args setting?
- How to modify URL structures in custom post types and taxonomies or terms
- Help with a TV series Rewrite structure
- Custom permalinks
- array_pop() expects array, boolean given for $event_type_term ->slug
- custom post type permalinks with category and tags
- Permalink rewrite with custom post type and custom taxonomy
- Custom Permalinks for Custom Post Types and Taxonomies
- Custom Post Type with Nested Taxonomy and Template Files
- Semantic URL Custom Post Type and Taxonomies permalinks
- How to rewrite custom post type URL for multiple depths instead of one specific depth
- Custom post type category, taxonomy and URL rewrite problem
- Page to display an archive of taxonomies
- Custom Post Type: How to display all of same taxonomy?
- How to create a permalink for custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- How to show custom taxonomy in the permalink?
- Date-based permalinks for Custom Post Type, and custom taxonomy permalinks
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Include taxonomy slug in url?
- Custom permalink – append taxonomy name and term name at the end of permalink
- Permalinks for custom post-types within custom taxonomies not found
- custom post type and custom taxonomy url conflict
- Add hierarchical taxonomy to permalink for custom post type
- Custom post types, taxonomies, and permalinks
- Custom post types, taxonomies, and permalinks
- Parent & Child Taxonomy slugs in custom post permalink
- Custom Post Types and independent Categories – complex Taxonomy
- custom permalinks based on taxonomies for custom post type
- Custom taxonomy in URL showing 404
- Custom Post Type permalink shows wrong page: homepage/index.php
- 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
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- 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
- Permalinks /country/city/cpt/postname/
- Seamless permalinks between Custom Taxonomy and Custom Posts
- Custom post type and custom taxonomy with the same slug using the file page taxonomy only as directory
- Permalinks: custom post type -> custom taxonomy -> post
- How to change permalink to include custom post type
- Custom post type permalink tag 404
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- Custom post type and taxonomy permalinks
- Hierarchical permalinks for custom post type and taxonomy
- Best way to specify “article type” in URL
- Template for custom post type when taxonomy is in the URL
- How to filter a custom post type by custom taxonomy without 404
- Ideas on how to organize a project [closed]
- Change permalinks for custom post type based on taxonomy term
- Using page title as a link to term archive
- Is it possible to have hierarchical taxonomy and hierarchical custom post types in one permalink?
- Custom category URL not displaying posts
- Safe to throw 404 error in request filter?
- Multiple permalinks for a single post with multiple taxonomies
- Duplicate slug/permalink issue while adding same post name
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- Error 404 change permalink term custom term taxonomy
- How to prefix custom post type URL with custom post taxonomy term?
- How do you create pillar content pages?
- Custom post type single page returning 404 error when sharing archive url with custom taxonomy
- Custom post type single with custom URL structure
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- Pretty Permalinks with CTP and Taxonomies / Hierarchical
- Customise Permalink Structure For Custom Post Types
- % encoded URL giving 404 error in WordPress
- Issue with Custom Post Types and Permalinks
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Pagination not working (page/2 retunring 404 page)
- Custom permalink with custom taxonomies for custom post type
- Pretty permalink structure with multiple (AND OR) taxonomies
- Change the url of a custom post type to include taxonomy
- How to have permalink structure based on taxonomy terms
- Multiple archives for cpt, taxonomies, terms
- Multiple post types or single post type with category taxonomy?
- How to add base permalink to custom posts?
- How can I add a “fake” parent into the permalink?
- Permalinks when using Custom Post Type with static page for archive
- How to change permalinks to taxonomy and post type’s posts
- taxonomy term names in custom post type permalink structure
- Adding 2 CPT with multiple custom taxonomies to permalinks
- Parent cpt/child custom post type URL permalink relationship
- Custom Post Type Permalinks Problem
- Change Taxonomy Permalinks
- Permalink for Custom Post Types
- Remove slug from Custom Category Permalink + dual-category permalinks
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- Add /blog to the “post” post type url
- Different CPT permalink base on taxonomy
- Hide custom post type slug url from search engine [closed]
- Is it possible for post and custom post type to share a category base slug?