Convert Wordpress url with querystring to slash-delimited "friendly" url

53 Views Asked by At

I want this link: site.com/c/web/theme/?filter_cms=wp

Convert to: site.com/c/web/theme/wp/

I found this code and edited it a bit:

add_action('init', function () {
     add_rewrite_rule('^c/web/theme/([a-z]+)/?$', 'index.php?product_cat=theme&filter_cms=$matches[1]', 'top');
});

it displays the desired category(theme) perfectly, but it does not display our filter query: ?filter_cms=wp! What is the problem?

c = WooCommerce category prefix

web = WC category

theme = WC sub-category

cms=wp = WooCommerce attribute

0

There are 0 best solutions below