これまでのところ、これは「セッション」「秋」アイテムのみをフィルタリングして表示することで機能しています。
<?php
$the_query = new WP_Query( array(
'post_type' => 'classes',
'meta_key' => 'sessions'
'meta_value' => 'Fall',
'posts_per_page' => -1
));
while ($the_query->have_posts()) :
$the_query->the_post();
?>
しかし、「秋」と「Monon Community Center」にあるアイテムのみをフィルタリングして表示したい
'meta_key' => 'location_select',
'meta_value' => 'Monon Community Center',
どうすればこれを達成できますか?
私もこれを試しましたが、うまくいきませんでした
$the_query = new WP_Query( array(
'post_type' => 'classes',
'meta_query' => array(
'relation' => 'AND',
array(
'meta_key' => 'location_select',
'meta_value' => 'Monon Community Center',
'compare' => '='),
array(
'meta_key' => 'sessions',
'meta_value' => 'fall',
'compare' => '='),
'posts_per_page' => -1
)
));
while ($the_query->have_posts()) :
$the_query->the_post();