Filter by dropdown custom field on WP_QUERY ?
-
Hi there.
Firstly, this plugin is so amazing. I just have a question:
How I can filter by a dropdown option on the WP_QUERY?
Example: I have a people
post_type
with a dropdown menu with acity
dropdown field, and I want to filter by those field.// Showing people $args = array( 'post_type' => 'people', 'meta_key' => 'city', 'meta_query' => array( array( 'key' => 'city', 'value' => 'Nelson', 'compare' => 'IN', ) ) );
As “
city
” is a “dropdown field
” and not a “text custom field
” i can’t really filter it, unless I change “city
” for a custom taxonomy.Thanksss
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Filter by dropdown custom field on WP_QUERY ?’ is closed to new replies.