I have taxonomy product_brand
and product_cat
I have a link:
/product_brand/brand_name/?attributes[product_cat]=product_cat_id
How to convert to pretty url?
/product_brand/brand_name/product_cat_name
function custom_rewrite_rules() {
add_rewrite_rule('^product_brand/(.*)/(.*)?', 'index.php?&attributes[product_cat]=$matches[1]', 'top');
}
add_action('init', 'custom_rewrite_rules');