Woocommerce--
Combine product attribute "collection" and product-tags in archives
Essentially create "pretty permalinks" for the current URL setup.
Current URL setup
https://******.com/product-tag/shower-curtain/?pa_collection=florida-east
Desired url setup
https://******.com/product-tag/shower-curtain/pa_collection/florida-east
Figured this out on my own
function custom_rewrite( $wp_rewrite ) {
$feed_rules = array(
'collection/(.+)/product-tag/(.+)' => 'index.php?product_tag='. $wp_rewrite->preg_index(2).'&pa_collection='. $wp_rewrite->preg_index(1)
);
$wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
}
// refresh/flush permalinks in the dashboard if this is changed in any way
add_filter( 'generate_rewrite_rules', 'custom_rewrite' );
Now how can I add the new pages to the sitemap?