0

I have a taxonomy problem that I've been trying to solve for days. I'll try to explain it.

I have two taxonomies, 'type of store' and 'state' of a post type called 'store'. I'm building a search that should display in which states, particular type of store is present. Just like which stores are in a certain chosen state.

In other words, when I choose a type of store, only states that have such stores should appear.

That way I can display the terms of both, but do not separate them.

$taxonomies = array('store_type', 'states');
$args = array(
        'taxonomy' => '$taxonomies',
        'hide_empty' => 'true',
        'parent' => 0,
        'tax_query' => array(
                              'relation' => 'AND',
                            ),
       );

Can someone please help?

0

Look at taxonomy parameters in WP_Query, the "Multiple Taxonomy Handling" example does pretty much what you want if I understand you correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.