Using multiple custom taxonomies
Usually, WordPress supports one category, one tag and one taxonomy in the search, if you use the query variables to set the taxonomies. You can enter multiple taxonomies as parameters to the query, but only the first one is used. If you want to have multiple taxonomies involved, you need……to build a tax_query. The correct format is described in the Codex. Of course, you can’t just pass the array in a query variable, so you’ll have to build it. Here’s how you do a two-taxonomy search. Search form First, we need to add the inputs to the search form….…in the search form code: wp_dropdown_categories( array( ‘name’ => ‘movie_director’, ‘taxonomy’ => ‘director’ ) ); wp_dropdown_categories( array( ‘name’ => ‘movie_actor’, ‘taxonomy’ => ‘actor’ ) ); Introducing the query variables WordPress cleans out unknown query variables for data hygiene reasons. That’s a good thing, but a bit of a complication for…