我在WordPress中有以下查询。我正在尝试从特定的分类中获取所有帖子并按顺序标题。它得到的帖子很棒但按日期排序(??)。
以下是查询:
<div><label><input type="checkbox" class="case"> One</label></div>
<div><label><input type="checkbox" class="case"> Two</label></div>
<div><label><input type="checkbox" class="case"> Three</label></div>
<div><label><input type="checkbox" class="case"> Four</label></div>
<div><label><input id="selectall" type="checkbox"> ALL</label></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
有人可以告诉我为什么在这段代码之后立即运行$the_query = new WP_Query(array(
'post_type' => 'faces',
'posts_per_page' => -1,
'tax_query' => array (
array(
'taxonomy' => 'faces-page',
'terms' => array(25, 29, 30),
'field' => 'id',
'orderby' => 'title',
'order' => 'DESC',
'operator' => 'NOT IN',
),
),
));
,我的输出如下(参见ORDER BY):
var_dump($the_query->request);
当然应该按标题排序,而不是日期?请帮助: - )
答案 0 :(得分:0)
$the_query = new WP_Query(array(
'post_type' => 'faces',
'posts_per_page' => -1,
'tax_query' => array (
array(
'taxonomy' => 'faces-page',
'terms' => array(25, 29, 30),
'field' => 'id',
'orderby' => 'title',
'order' => 'DESC',
'operator' => 'NOT IN',
),
),
'orderby' => 'title',
'order' => 'DESC',
));