您的查询会获取作者ID,如果希望按字母顺序排序,则需要获取作者(用户对象),因此请尝试:
$authors = $wpdb->get_results(\'SELECT DISTINCT post_author FROM \'.$wpdb->posts);
if($authors){
$users = get_users( array(
\'include\' => $authors,
\'orderby\' => \'display_name\'
));
foreach ((array)$users as $user) {
echo \'<li>\' . $user->display_name. \'</li>\';
}
}