1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| <?php global $wpdb;
$authors = $wpdb->get_results("SELECT ID, user_login from $wpdb->users ORDER BY display_name");
foreach ($authors as $author) { echo "<li><p><a href='".get_bloginfo('url')."/author/".get_the_author_meta('user_login', $author->ID)."'>".get_avatar($author->ID,50)."</a></p>";
the_author_meta('display_name', $author->ID); if(get_the_author_meta('url', $author->ID)){ echo "<p><a href='".get_the_author_meta('url', $author->ID)."'>个人网站</a></p>"; } if(get_the_author_meta('weibo_sina', $author->ID)){ echo "<p><a href='".get_the_author_meta('weibo_sina', $author->ID)."'>新浪微博</a></p>"; } if(get_the_author_meta('weibo_tx', $author->ID)){ echo "<p><a href='".get_the_author_meta('weibo_tx', $author->ID)."'>腾讯微博</a></p>"; } if(get_the_author_meta('description', $author->ID)){ echo get_the_author_meta('description', $author->ID); } echo "</li>"; } ?>
|
转自:WordPress首页做作者墙(作者列表信息)