在WordPress博客中显示文章作者头像及相关信息

在每篇文章末尾增加作者信息尤其适用于多作者的博客,简单明了,方便读者了解文章作者的个人信息。

本站示例:

HTML

<div id="article-author">
 <div id="author-image">
<?php if (function_exists('get_avatar')) { echo get_avatar( get_the_author_email(), '80' ); }?>
</div>
<div id="author-text">
 <strong><?php the_author_link(); ?></strong>
 <p><?php the_author_description();?></p>
</div>
</div>

CSS

#article-author {
margin-top: 15px;
margin-bottom: 15px;
margin-top: 30px;
border: 1px solid #d9d9d9;
clear: both;
background-color: #eee;
padding: 10px;
width: 468px;
height: 120px;
}

#author-image {
height: 80px;
width: 80px;
border: 1px solid #d9d9d9;
background-color: #FFFFFF;
padding: 10px;
margin-bottom: 8px;
float: left;
}

#author-text {
float: left;
margin-left: 10px;
width: 350px;
}

上面显示的用户信息,可以在 WordPress 控制板/用户 中设置,如下所示:

上面涉及到一些Wordpress函数,这里就不多说了,具体请参考 WordPress函数讲解-Author Template Tags

1 Comment

  1. Pingback: 如何在标题前显示作者的头像 | Open 2 L

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!:

无觅相关文章插件,快速提升流量

任鸟飞网页设计博客 谜题推理 No.1 Web Design Gallery IndustryIdea LookForDesign AWebGallery Mobile Web Template iDesign Wallpaper Big Funny Picture iPhone Faves iPhone Mobi iPad Faves Android Faves BlackBerry Faves Best Design Magazine All Banner Templates Blog Earn Tips 是谁啊 只爱美人 家乡美 唯美爱 美人衣妆 AutoCAD 2D | Pro/E 3D江苏名企The HTML5 Templates