I found the solution.
function add_rewrite_rules($rules) {
$newrules = array('cpt-slug/([^/]+)/([^/]+)/?$' => 'index.php?name=$matches[1]&post_type=cpt_name&member_view=$matches[2]');
$rules = $newrules + $rules;
return $rules;
}
You just need to change ‘p’ to ‘name’
Related Posts:
- Rewrite custom post & taxonomy to share same URL path
- Permalink misbehaving in Custom Post Types
- How to create custom search result page with custom URL parameters for custom post type?
- Adding /blog in front of single posts (only)
- Define multiple prefixes for custom post type
- Rewrite url post_tag for custom post type
- Mixing custom post type and taxonomy rewrite structures?
- How to rewrite URI of custom post type?
- Front end post editing using a form
- Set posts of a custom post type to be private by default?
- Custom post types – Use post_id in permalink structure
- Custom Post Type and Taxonomy URL rewrite
- Rewrite custom post type rss feed links
- How make get_next_post() return first post when viewing last one
- Archive page with multiple taxonomies rewrite
- rewrite get parameter with custom post type
- How can I add dropdown widget/box to admin post page?
- Taxonomy page returns 404 page not found
- Remove unwanted part of permalink custom structure from CPT url?
- How to have a custom URL structure for a custom post type?
- Custom permalinks – post type – hierarchical taxonomy’s
- Changing a custom post type “has_archive” after registered
- How to show related posts by category or custom post type?
- ascending order custom post type
- [Plugin: Posts 2 Posts] Changing display order of connections
- Display taxonomy term only if there’s a value
- Custom Post Type rewrite redirects to homepage
- How to show post title outside of loop? [closed]
- Custom Post Type slug same as page name causing a conflict
- How to delete all posts from a custom post type?
- Adding paged query to custom URL rewrite
- Update content of multiple pages/posts at once?
- Customising rewrite rules for CPT single post URL to work as paged URL
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Remove custom post type slug not working for child pages
- Custom WP TItle from custom template with dynamic URL structure
- CPT’s archive and single page not working [closed]
- Rewrite rules for custom post type slug
- Trying to edit the single page from a Custom Post
- How to Submit Post Via cURL & PHP
- Change URL of posts and also Custom Post Type
- is there a way to retrieve posts that do not have a featured image assigned?
- Custom Post Type rewrite
- Remove url rewrites for registered taxonomies
- Get Taxonomy Term Title by it’s URL
- Using taxonomy term in CPT permalink – Pages 404’s
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Why isn’t my custom post type archive URL translating?
- Post Type rewrite rule to point to custom Page/template
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- Ignoring slug capitalization on rewrite rule for custom post type archive page
- Taxonomy in URL
- How to sort posts in a custom post type by title in ascending order by default?
- Conditional for a Single Post That Belongs to a Category?
- $post not working working in AJAX plugin with custom post type
- Multiple pages per post (not pagination)
- Variable not working in WP_Query
- What’s an efficient way to change the post status of many posts at once?
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- WordPress notification if new post published
- How do I know if a rewritten rule was applied?
- How to handle new post from API request?
- Restrict category access to specific users/groups. Author always has access
- How Can I Remove Custom Post Type Slug From URL
- WordPress custom permalink and archive link for custom post type
- Render a Post or Page using the correct file
- WordPress Count posts within a custom post type
- Custom Post Types and Removing Slugs – should we do it?
- Copy/Move selected taxonomy terms to another taxonomy for posts
- Taxonomy rewrite pagination 404
- WordPress post carousel
- Custom post type tags not showing in search
- How to setup different permlalinks for posts and pages?
- Remove cpt slug from url and use custom taxonomy instead breaks all other cpt
- How to properly set the rewrite rules for this case?
- wp_post_delete is deleting all offices
- Why doesn’t wp_delete_post allow trashing for custom types?
- How to fix 404 on post after prepending Custom Post Type url with Custom Taxonomy Term slug
- Custom post type structure + permalink structure
- Rewrite URL of Specific Post of Custom Type
- post type => ‘any’ not applied my custom queries
- Using get_post_type with a custom URL format?
- Using Orderby and meta_value to order natural/alphanumerical
- WP_posts (Not meta) extra custom field column show and change it in a custom post type
- how to make custom post with “publish” default functionality not save in draft?
- Post that populates itself (almost) automatically using data from imported excel file
- Show index and not the archive for “Dog Custom Post” with default slug
- Paging not working for hierarchical custom post type
- How to display data with pagaination on backend?
- Edit post meta direct from post.php?
- How to Arrange Support => Thumbnail
- Why won’t this rewrite rule work?
- Front-end form submission not creating post
- Post being scheduled that shouldnt be schedulded
- Generating custom URL before post is published
- Custom post type permalink structure
- Get custom post type parent category
- show the most recent date of all posts to display on front end
- Sort ACF by custom taxonomy
- Custom slugs with dates & IDs on Custom Post Type