任何人都可以建议为什么以下WP查询不起作用?
<?php if (is_page(10)) {
$taxTerm = "restaurants";
} elseif (is_page(12)) {
$taxTerm = "offices";
} elseif (is_page(14)) {
$taxTerm = "hotels";
} elseif (is_page(16)) {
$taxTerm = "flowers";
} elseif (is_page(18)) {
$taxTerm = "green-walls";
}
$args = array(
'post_type' => 'gallery_items',
'tax_query' => array(
array(
'taxonomy' => 'industries',
'field' => 'slug',
'terms' => $taxTerm,
),
),
'order' => 'DESC',
'orderby' => 'title',
'posts_per_page' => '5',
);
它似乎不喜欢tax_query?虽然这个编码与编码时的编码匹配吗?