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?
- How to remove slug from hierarchical custom types in 3.5.2
- Remove slug in taxonomy url
- Pagination throws 404 error on custom taxonomy archive pages
- custom post type and custom taxonomy permalink
- Is there a way to use regular categories with custom post types?
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- Taxonomy archives based on Custom Post Type
- Multiple custom post types using the same taxonomy = URL frustrations
- Remove unwanted part of permalink custom structure from CPT url?
- Custom permalinks – post type – hierarchical taxonomy’s
- Permalinks for CPT breaks permalinks to pages
- Changing a custom post type “has_archive” after registered
- How to create a permalink for custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- Date-based permalinks for Custom Post Type, and custom taxonomy permalinks
- Custom Post Type slug same as page name causing a conflict
- Custom Taxonomy breaking pages permalinks
- Custom post types and permalinks
- Change URL of posts and also Custom Post Type
- Custom Post Types and independent Categories – complex Taxonomy
- Use different taxonomies in different custom post types’ permalinks?
- Custom template won’t load for a custom post type (custom permalinks used)
- Remove url rewrites for registered taxonomies
- How to hook custom taxonomies to custom post types and make the permalinks work?
- Get Taxonomy Term Title by it’s URL
- How to have the same url structure for both a CPT and a Taxonomy?
- Can’t remove front from permalinks for custom taxonomy category page
- Using taxonomy term in CPT permalink – Pages 404’s
- Custom post type, permalinks, taxonomies and blog posts
- Lost of query parameter when using permalink
- Custom post type Permalinks with hierarchical Taxonomies
- Problems with 404, .htaccess, permalinks and WordPress custom posts locally on Snow Leopard
- Can’t use pagination with custom taxonomy
- Dynamic CPT permalink structure based on ACF field value
- Custom taxonomy and post type rewrite rules
- Custom Post Type and Taxonomy Rewrite Error
- custom posts permalinks url rewriting
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- Display CPT taxonomies as an archive page
- Redirect Custom Post Type from Child Taxonomies
- Register post type getting error 404
- CPT url rewriting : regular posts return 404 error
- Custom Post type and Taxonomy in post URL error
- One custom post type with two different url structure base on taxonomy term
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- WordPress Custom Permalink Structure with Custom Post Type and Taxonomies
- How can you preserve URLs when moving posts to a custom post type?
- Permalinks Works for Custompost type but not with pages Why?
- Problem with Custom Post Types, Taxonomy, permalink, Archive
- Two Permalinks with one Taxonomy (custom taxonomy) and (custom post type -> custom taxonomy)
- Modify permalink of CPT archive to support two taxonomies
- Have Custom Taxonomy Slug Fall Under Custom Post Type Slug
- Custom Post Types Do Not work on this permalink setting https://somedominaname.com/%category%/%postname%/