I can’t set meta_key in my custom post type query
That’s because ‘meta_key’ and ‘meta_value’ are not public query vars. In other words, you can’t use them in URLs directly, nor should you. Instead, register a specific query var, like so: function register_my_qv() { global $wp; $wp->add_query_var( ‘my_qv’ ); } add_action( ‘init’, ‘register_my_qv’ ); Then, you can go to a URL like this: ?my_qv=foobar All … Read more