我的博客上有两位作者和一位管理员。我在我的贡献者中使用以下代码。php
function contributors() {
global $wpdb;
$authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users ORDER BY display_name");
foreach($authors as $author) {
echo the_author_image($author->ID);
echo the_author_meta(\'display_name\', $author->ID) . \'</br>\' ;
echo the_author_meta(\'user_url\', $author->ID) . \'</br>\';
echo the_author_meta(\'description\', $author->ID) . \'</br>\' ;
echo the_author_meta(\'user_email\', $author->ID) . \'</br></br>\' ;
}
}
contributors();
它完美地打印了所有作者和管理员的照片、姓名、描述和电子邮件。但它没有正确打印用户链接。
对于管理员或用户ID 1,它正在打印博客URL;对于第一作者或用户ID 2,它正在打印正确的URL有什么问题?我如何解决这个问题?