I am trying to do a tax-query on a hierarchical taxonomy with no tags. I want to show results for the dealer state and brand being viewed by the user. For instance dealers in texas that also carry honda. I only want to show the results if the meta key value of wpcf-paid is 1 for the dealers.
I have the below code, but it does not seem to work. Any suggestions?
Thank you!
$args = array(
'post_type'=>'dealers',
'meta_key'=>'wpcf-paid',
'meta_value'=> '1',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'dealerstate',
'field' => 'id',
'terms' => 'terms' => get_terms( 'dealerstate', array( 'fields' => 'ids' ) ),
'operator'=> 'AND'
),
array(
'taxonomy' => 'brands',
'field' => 'id',
'terms' => 'terms' => get_terms( 'brands', array( 'fields' => 'ids' ) ),
'operator'=> 'IN'
)
)
);
query_posts( $args );