Hi @bcworkz,
As you have suggested, I have switched the theme to twentytwenty and deactivated all plugins. I have added the following code in the twentytwenty theme’s function file.
add_action('init', 'custom_rewrite_tag', 10, 0);
function custom_rewrite_tag() {
add_rewrite_tag('%catslug%', '([^&]+)');
}
add_action('init', 'custom_rewrite_basic', 10, 0);
function custom_rewrite_basic() {
$prolist_pageid = get_id_by_slug('propositions');
add_rewrite_rule('^propositions/([a-zA-Z0-9\-]+)/?', 'index.php?page_id='.$prolist_pageid.'&page=propositions&catslug=$matches[1]', 'top');
}
What exactly I want to need and how I’m doing it for that is:
I am already having a page named “propositions” and it has the same slug (propositions). Now, by using a rewrite function, I want to add the extra slug just after the “propositions” so that I have taken the “catslug” parameter as you can see in the above code. After adding the code, I’m updating the permalink by hitting the save button only.
I want this URL to be worked: https://sitename.com/propositions/test-proposal
where the “test-proposal” is not an actual page but I’m passing it in the URL as a “catslug” parameter.
The above URL should work and it was worked in the past version than WP 5.5 but now it’s not working and when I run that, it’s automatically redirected to https://sitename.com/propositions/ page.
Hope you understand what I explained and help with that.
Thanks!
Priyanka.