I have the following url and I'm using the type
parameter in a WP_Query
to generate a list of posts.
http://wordpress.dev/en-ie/category-holiday-deals/?type=city-breaks
I want to rewrite the url so it looks like this:
http://wordpress.dev/en-ie/holiday-deals/city-breaks
but I want to be able to use the type
param still.
I have the following that's capturing the query vars:
add_filter('query_vars', 'sd_query_vars', 10, 1);
function sd_query_vars($vars) {
$vars[] = 'type';
$vars[] = 'destination';
return $vars;
}
but I can't figure out how to rewrite the URL.
Any suggestions?