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
- Restrict custom post type from appearing with ?post_types=
- Change custom post type slug from plugin options
- Show custom post type filtered by category
- create parent post using wp_insert_post
- Turn on and off custom post type from admin?
- Missing Posts in Custom Taxonomy List
- Display random posts, but omit the post it is on?
- Rewrite rules for custom posts types
- How do I do this with WordPress? Taxonomies?
- Disable block with taxonomies at post page
- I would like to have different styles for my posts based on the content of each post
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- Rewrite post type slug only for child theme
- wp_list_categories() – current-cat class also inside posts?
- Custom Post Types, URL rewrite on multiple CPTs
- Showing posts from different categories and from custom post type
- Get latest 3 posts from multiple CPT in one query
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Which post does a taxonomy term belongs to?
- How can we take into account post types when constructing permalinks?
- List custom taxonomy specific to one custom post type
- Post image in WordPress not appearing on home page
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- 404 Issue w/ Custom Post Type – using Meta for Permalink rewrite
- Meta query for custom post type ignored in main query
- Get Taxonomy Term Title by it’s URL
- Changing custom type name hides the posts
- Display Ad on Specific Categories
- Taxonomy custom post type URL
- How to change custom post type permalink structure
- Hiding posts by other users and non-logged in
- Front custom edit post page for each post
- Adding custom post category slug in permalink causes 404 error for pages and posts
- Categories of Custom Post throws gives 404
- How can I use get_post_meta with add_rewrite_rule to build custom permalinks?
- How to build custom route by adding taxonomies to URL ? ex: www.demo.com/communities/palo-alto/
- Update Post Meta for a logged in user
- Add custom field to Posts and sort by it
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- Add custom post type settings to wordress default 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?
- Custom rewrite url category
- Rewrite Question Mark in Post Template to Make it Pretty URL
- Get related posts of child term of custom post type
- Two Custom Post Types Many to Many Relationship
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- Problem with displaying posts in the CPT category
- Index page with the same id as the slug
- JS innerhtml changing style when using AJAX
- Show titles, date of all posts on single category page
- How can I make the slug of the taxonomy also the slug of the custom post
- WordPress custom post type permalink rewrite shows page not found
- Using taxonomy term in CPT permalink – Pages 404’s
- Side effects of Script and Iframe in post
- How to add rewrite rule to custom post type with parent in url with cpt ui?
- Custom post type as home page with custom url
- Customize Custom Post Type URL
- How to rewrite url for any specific taxonomy?
- Custom post URL 404 error
- Programmatically rewriting slug through functions.php but returns 404
- How to change the post type a theme shows by default?
- How do I change the custom taxonomy slug to be the same as the custom post type slug?
- URL rewrite add author as base
- Set a checkmark in a category based on a URL-parameter
- Custom Permalink to remove category word , keeping posts permalink with date?
- Several post types on WP Query by tag and taxonomy
- No Permission to add new Page, Post or CPT with Admin role
- Update postmeta Parent when post_status child change
- custom post type category count shortcode
- Portfolio Page for Classic Posts
- Set a CPT slug as a base name for all the taxonomies
- Custom taxonomy rewrite with query var returns %2F in URL
- WP Rewrite Rule Issue while using Custom post type & taxonomy
- Remove slug in URL custom post type
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Rewrite custom post type url – Multiple post types
- Add post location with mile radius allowing search
- Why isn’t my custom post type archive URL translating?
- Custom Post Type and Category Base Rewrite Issue
- Versioned Custom Post Type (Not the same as revisions)
- Rewrites/query for multiple hierarchical custom post types
- Get the category from custom post type
- WordPress custom post type split into pages
- Is it possible to store Custom Post Type data in separate set of tables and still have wp_post class functionality?
- cpt and page sharing same base permalink
- Set up post page like JAMA articles
- WordPress uses url different from defined in rewrite arg of custom post type
- Rewrite URL of Custom Post Type for Jobs
- Custom post Type, child of a Page?
- Custom Post Slug same as Parents Category Slug
- Hide or disallow default custom post type url?
- Shortcode not working with post counter