我使用以下代码在页面模板中包含来自作者(WordPress用户)的信息。可以反过来排除作者。
<?php
//display selected users
$userids_to_display = array(4,221,22,3,5,9,235,236,250); // wordpress user IDs to include
$blogusers = get_users_of_blog();
if ($blogusers) {
foreach ($blogusers as $bloguser) {
if ( in_array($bloguser->user_id, $userids_to_display) ) {
$user = get_userdata($bloguser->user_id);
echo \'<div>\';
echo \'<div class="alignleft">\'.get_avatar($user->ID).\'</div>\';
echo \'<div class="user-data"><h3>\' . $user->user_firstname . \' \' . $user->user_lastname . \'</h3>\';
echo \'<div class="author-description">\'.$user->description.\'</div>\';
echo \'</div>\';
}
}
}
?>