関連する投稿を取得するために複数の分類クエリを使用しています
$tax_query[] = array(
'taxonomy' => 'transfer_type',
'field' => 'id',
'terms' => $page_terms['type_term'],
'include_children' => false
);
$tax_query[] = array(
'taxonomy' => 'area',
'field' => 'id',
'terms' => $page_terms['area_term'],
'include_children' => false
);
$args = array(
'post_type' => 'category_description',
'tax_query' => $tax_query
);
$description_post = get_posts($args);
投稿が transfer_type と area でタグ付けされている場合は問題ありませんが、投稿がそれらの 1 つだけでタグ付けされている場合、結果は間違っています。
私は基本的に(場合によっては)「area」または「transfer_type」を持つすべての投稿を除外し、他のものと一致するものだけを取得したいと考えています。
出来ますか ?