WP_Query()Bazı yayınlarımı filtrelemek için sınıfı kullanmak istiyorum . Şimdi karşılaştığım sorun sınıflandırma sorgusu ele alıyor. Normalde, WP_Query()tek bir ilişki tax_query()(VE veya VEYA) için işlemek , ama ihtiyacım olan bu ilişkilerin karma kullanımı tax_query(), nasıl başarabilirim?
Örneğin
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'taxonomy1',
'field' => 'slug',
'terms' => array( $term)
),
array(
'taxonomy' => 'taxonomy3',
'field' => 'slug',
'terms' => 'terms' => array( $term3),
'operator' => 'IN',
)
// below i want to use OR relationship
'relation' => 'OR',
array(
'taxonomy' => 'taxonomy4',
'field' => 'slug',
'terms' => array( $term4)
),
array(
'taxonomy' => 'taxonomy2',
'field' => 'slug',
'terms' => 'terms' => array( $term2),
'operator' => 'IN',
)
)
Yukarıdaki kodun çalışmadığını biliyorum, bunu yapmak için WP_Query()filtre kullanmam gerekir mi? Herhangi bir fikir?