This is very easy to do by adding custom rewrite rules. This should get you started:
add_action( 'init', 'wpse_100386_rewrites' );
function wpse_100386_rewrites() {
add_rewrite_rule( 'case-studies/room/([^/]+)/?', 'index.php?the_room=$matches[1]&post_type=the_case_study', 'top' );
add_rewrite_rule( 'videos/room/([^/]+)/?', 'index.php?the_room=$matches[1]&post_type=the_video', 'top' );
}
As always when changing rewrite rules, be sure to flush your rewrite rules by going to Settings -> Permalinks and click “Save Changes”.
Related Posts:
- Mixing custom post type and taxonomy rewrite structures?
- Rewriting a custom-post-type permalink with taxonomy term?
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Custom post types – Use post_id in permalink structure when using has_archive => true
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- How to modify URL structures in custom post types and taxonomies or terms
- Archive page with multiple taxonomies rewrite
- Custom permalinks
- Permalink rewrite with custom post type and custom taxonomy
- Custom Permalinks for Custom Post Types and Taxonomies
- Including two taxonomies in a permalink structure
- WP Rewrite Rules – Custom post type & taxonomy
- Remove base slug in CPT & CT, use CT in permalink
- How to rewrite custom post type URL for multiple depths instead of one specific depth
- Custom post type category, taxonomy and URL rewrite problem
- Permalink Structure problem with cpt and custom taxonomy
- Custom Permalink Tag breaks Pagination
- Custom Permalink for Taxonimie and Custom Post Type
- multiple url slug for single custom post type
- custom taxonomy archive by year
- Custom Post Type and Custom Taxonomy Permalinks
- Permalink Structure CPT With Custom Taxonomy Fails
- Change Permalink Structure for Tag.php template
- Custom taxonomy in URL showing 404
- Adding custom post category slug in permalink causes 404 error for pages and 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
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- Customize Custom Post Type URL
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- Custom taxonomy returns 404
- CPT’s with landing page instead of archive – Url Rewrite?
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- Custom permalink with child taxonomy terms
- Best way to specify “article type” in URL
- Custom Post Type Advanced Slug
- 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
- Archive page for custom post type and custom taxonomy
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- Pretty Permalinks with CTP and Taxonomies / Hierarchical
- Customise Permalink Structure For Custom Post Types
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Parent cpt/child custom post type URL permalink relationship
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- Permalinks: custom post type -> custom taxonomy -> post
- Filtering a custom post type by custom taxonomy in archive template
- Custom Post Type and Taxonomy URL rewrite
- Custom post type permalink: only use %post_id% and remove %postname%
- rewrite get parameter with custom post type
- Help with a TV series Rewrite structure
- Taxonomy archives based on Custom Post Type
- Multiple custom post types using the same taxonomy = URL frustrations
- Permalinks for CPT breaks permalinks to pages
- Page to display an archive of taxonomies
- 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 create archive page for taxonomy terms within custom post type
- Date-based permalinks for Custom Post Type, and custom taxonomy permalinks
- Category and post tag archives do not include posts from custom post type
- Permalinks for custom post-types within custom taxonomies not found
- Parent & Child Taxonomy slugs in custom post permalink
- Custom Post Types and independent Categories – complex Taxonomy
- Custom Post Type Archive Page Filtering
- Create template for taxonomy results limited by Custom Post Type
- 404 Issue w/ Custom Post Type – using Meta for Permalink rewrite
- How to add rewrite rule to custom post type with parent in url with cpt ui?
- How do I change the custom taxonomy slug to be the same as the custom post type slug?
- 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
- set permalink for CPT
- What’s the name of the custom post type yearly archive template?
- Custom URLs in post types make it impossible to view archive
- Custom taxonomy or custom page templates?
- Permalink problems with custom post type and custom taxonomy
- Only show posts with a specific term of an associated taxonomy in a custom post type archive
- Route subpage to Custom Post Type
- Use the custom post type archive for taxonomies?
- How can I tell if I’m on a custom post type archive page?
- Adding /blog in front of single posts (only)
- Changing permalink of default Post with custom post
- Custom Taxonomy Archive generates 404
- How to create a permalink structure with custom taxonomies and custom post types
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Post Custom & Taxonomy 404 error
- Custom Post Type tag taxonomy “Page Not Found”
- Remove custom post type slug but keep related category taxonomy permalink
- page not found for example.com/custom-post-name
- Force WordPress to only match URL in category
- Same permalink structure for all post types?
- Custom post type with parent page? Possible?
- Hierarchical taxonomy in permalink structure
- Why won’t this rewrite rule work?
- Archive.php is not displaying tags
- Adding rewrite rules to Custom Post-type mixed with Taxonomy
- Custom post type permalink structure
- How can i change url structure of cpt like this?