你需要在你的author.php
文件摘自法典。http://codex.wordpress.org/Author_Templates
<?php get_header(); ?>
<div id="content" class="narrowcolumn">
<!-- This sets the $curauth variable -->
<?php
$curauth = (isset($_GET[\'author_name\'])) ? get_user_by(\'slug\', $author_name) : get_userdata(intval($author));
?>
<h2>About: <?php echo $curauth->nickname; ?></h2>
<dl>
<dt>Website</dt>
<dd><a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></dd>
<dt>Profile</dt>
<dd><?php echo $curauth->user_description; ?></dd>
</dl>
<h2>Posts by <?php echo $curauth->nickname; ?>:</h2>
<ul>
<!-- The Loop -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
<?php the_title(); ?></a>,
<?php the_time(\'d M Y\'); ?> in <?php the_category(\'&\');?>
</li>
<?php endwhile; else: ?>
<p><?php _e(\'No posts by this author.\'); ?></p>
<?php endif; ?>
<!-- End Loop -->
</ul>
要获取个人资料照片,您需要使用get_avatar
函数并使用用户电子邮件作为参数。
<?php echo get_avatar( $curauth->user_email ); ?>
有关的更多信息
get_avatar
此处:
http://codex.wordpress.org/Function_Reference/get_avatar