I am using WP rewrite rules for my custem arguments,
But when I am trying to generate permalink like this:
add_query_arg(array(
'type' => 'foo',
'paged' => 2,
),get_permalink($id)) ;
It returns still:
mysite.com/products/?type=foo&paged=2
But I need to turn it into this:
mysite.com/products/foo/2
Rewrite rules work perfectly, but "add_query_arg"..
How to solve?
add_query_argis for adding query string arguments, not for generating pretty permalinks. what context are you using this in exactly? have you already added yourtypequery var and added a rewrite rule to handle incoming requests viaadd_rewrite_rule? – Milo Feb 6 at 0:30