我的查询:
$the_query = new WP_Query(array(
'orderby' => 'title',
'order' => 'ASC',
'showposts' => -1
));
但显示不正确(请访问http://animevd.com/anime-list)。 ''在'b'之前和'b'之前'。'
答案 0 :(得分:0)
试试这个:
$the_query = new WP_Query(array(
'orderby' => 'title',
'order' => 'ASC',
'posts_per_page' => -1
));
答案 1 :(得分:0)
您需要使用:
$the_query = new WP_Query(array(
'orderby' => array( 'title' => 'ASC' ),
'showposts' => -1
));
您还可以通过多个参数进行排序,例如:
$the_query = new WP_Query(array(
'orderby' => array( 'menu_order' => 'ASC', 'title' => 'ASC', 'post_date' => 'DESC' ),
'showposts' => -1
));