How to filter custom post type archive by meta value

Like Bainternet said in comments, you’ll need to mess with add_query_var as well as add_rewrite_rule.

We usually do something similar to:

global $wp;
$wp->add_query_var( 'some_var' );
add_rewrite_rule( 'some/path/([^/]+)/?$', 'index.php?some_var=$matches[1]' );

See this WordPress Trac ticket, as well as documentation on add_query_var and add_rewrite_rule

Leave a Comment