$args = array(
\'post_type\' => \'mcm_company\',
\'orderby\' => \'title\',
\'order\' => \'ASC\',
\'posts_per_page\' => \'1000\',
\'post_status\' => \'publish\',
);
$r = array();
$the_query = new WP_Query( $args );
我希望看到结果按字母顺序返回,但事实并非如此。最后一个查询是
[request] => SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = \'mcm_company\' AND ((wp_posts.post_status = \'publish\')) ORDER BY wp_posts.menu_order ASC, wp_posts.post_title ASC LIMIT 0, 1000
你可以看到这是错误的
ORDER BY
. 我假设有什么东西正在覆盖
orderby
... 有没有办法强制订单标题?
问题来自Post Types Order插件,启用了自动排序选项