Not sure of the context for this, is it a custom post type or just a page?
This might be something which you’re looking for –
function add_lead_management_endpoints() {
add_rewrite_rule(
'manage-lead/lead_id/([0-9]{1,})/product_id/([0-9]{1,})',
'index.php?pagename=manage-lead&lead_id=$matches[1]&product_id=$matches[2]',
'top'
);
add_rewrite_tag( '%lead_id%', '([^&]+)' );
add_rewrite_tag( '%product_id%', '([^&]+)' );
}
add_action( 'init', 'add_lead_management_endpoints' );
You’ll need to flush permalinks for this to take affect (visit settings->permalinks).
Related Posts:
- How to stop wordpress to make the default query?
- Query two taxonomies via URL or link?
- Can not switch the queried post in pre_get_posts hook
- Is there a PHP function that can match anything after the given URL, so my IF statement will work in each instance?
- Get rewrite result
- Difficulty with rewrite rules
- remove query arg from url after set query
- WordPress add_rewrite_rule() cannot visit lower url levels
- Serve specific “template” page at any URL that ends in its slug
- How to figure out redirection and contents in hybrid solution containing word press content and legacy code (ASP.net)
- How to use if($wp_query->query_vars[‘name’] == ‘pagethatdontexist’) without getting a 404? How to suppress 404
- JSON – Create rest api endpoint for Advanced Custom Fields
- WordPress rewrite with custom parameter doesn’t work
- How to allow a variable with “/” in wordpress url
- How can I re-query post_type and rewrite the url?
- Rewrite rule pagination on different url levels
- How to list posts of a given format
- Pagination on custom post type not working
- Wp_redirect and sending variables
- How do I get posts that have a thumbnail in WP_Query?
- Multiple WP_Query loops with Pagination
- WP_Query with checkbox meta_query
- IP address character limit
- What is the most efficient way of querying posts based on visits and date for current day?
- Does WordPress generate an automatic page for post formats?
- How to add custom query filters in WP_User_Query
- Is “orderby” in WP Meta Query conflicting with Meta Query?
- Pagination/infinite scroll with WP_Query and multiple loops
- WordPress meta_query and order by custom field
- Shortcode returns escaped HTML tags
- Get number of comments after modifying comment query
- How to change a custom query into a standard loop?
- Sort users by meta_value_num
- How can i make WP_Query return post image and categories?
- Filter WordPress posts by between parameter
- 2 loops on page – one with orderby rand second orderby date
- Undefined WP_Query::has_posts()?
- WP_Query returning no results
- Splice together 2 WP_Query objects
- How to access a query twice in different template files?
- Complex Category selection as per user input
- How to set multiple `orderby` in query argument?
- WP_Query posts_per_page Only Bringing Back one post
- How to get all unique categories for posts in loop?
- Query that loads a custom type AND posts whose ids are not inside those custom types custom fields
- Get authors by term id or slug
- Get and Trim Full Post Content in WP Query
- Transient not behaving as expected
- how can I override The Events Calendar query modifications?
- the_post() within switch_to_blog() altering my excerpt
- No results found from a $wpdb->get_results() query when trying to join more than one meta key query
- WP_Query post_parent parameter always returns children of current page
- Query about wp_query
- wp_query sort with meta_value_num is not working
- empty WP_Query object on local install
- Query posts only without featured image
- How to use WP_Query() on single.php?
- Tax Query only returns for the first of several terms
- Can’t fetch Custom Post Type Data through Custom Query
- Loop increase in while loop not working
- Get All posts by Tag_Id not working, query seems to contain extra term_taxonomy_id
- Is this meta query problematic?
- Appending to existing WP_Query’s meta_query if exists
- Yoast primary category query modification
- How To Keep Search Title the same on paged Results
- Excluding posts with certain value of meta_key keeping posts without that meta_key
- Filter out a meta key in the Search results page with two CPT
- Function using get_posts() with tax_query not working when called from functions.php
- Include one page/post into query which is already returning posts
- Search for pages with permalink
- How to add a recent post function to a text widget I created for practice?
- Can I make a search query which includes a space?
- Help with if statement inside while loop
- wp-query problem with author
- WP_Query – display posts by custom field and order by another
- Custom WP Query order function possible?
- Pagination unique to a widget
- Is the ‘parse_query’ filter still valid to change filtered content on admin list view?
- I removed the “wp_rm_logs” table and am constantly getting this error
- How to set selected attribute on option after filter query?
- custom search form, posts_per_page value being ignored
- WP_Query returns empty if meta_query has more than 7 values
- Fetching $_POST from Page Template into functions.php
- query.php – multiple is_category functions
- Custom query with post_class filter using current_post not working
- Overwriting auto-appended NOT IN query in WP_Query
- posts_per_page not returning correct number of posts
- Conditionals in WP_Query
- Why WP_Query in functions.php is not working when get_posts works?
- Next / previous posts link doesn’t show up with Posts 2 Posts
- Loop the posts between two dates selected using jquery datepicker
- Passing conditional arrays to WP_Query() [closed]
- query by meta value then date and not empty meta value
- Issue with sorting by post date and custom post type
- wordpress sorting using array merge by price in ascending order but price with 0 must be show last
- Carousel Loop only duplicating
- Remove divs and spans from post content
- Can’t get LIKE to work with wp_query [closed]
- Get all user with both meta_value
- I want to capture the last day’s (today) posts in a category in the numbered order in acf