在WordPress中,post slug保存在名为的数据库中post_name
, 因此,要按slug对帖子进行排序,只需使用:orderby=name
.
Edit:
以下是查询示例:
$args = array(
\'post_type\' => \'post\',
\'post_status\' => \'publish\',
\'posts_per_page\' => 10,
\'orderby\' => \'name\'
);
$query = new WP_Query( $args );