作者:noupe 来源:怒风的Blog 酷勤网收集 2008-08-27
在你的博客上有多个作者将非常有趣,我们需要一个好的方法来弄作者有关网页:显示他们最新的文章,高亮显示他们的评论,以及在每篇文章下方显示他们的头像和简介.
1. 在你的wordpress博客上创建作者页面
默认情况下,Wordpress将先使用author.php模板然后是archive.php最后是index.php来显示作者信息. 意思是,如果你没有author.php文件, WordPress将使用archive.php, 以此类推.
所以, 如果你想更换作者页面的外观, 你需要创建一个author.php文件(如果主题没有),方法:复制archive.php或index.php.
如果你想要显示作者的主要网站,email联系地址,简介来帮助读者更好地认识这个作者,在适当位置加入下面的代码:
Articles by <?php the_author(); ?>
Author Website: <?php the_author_url(); ?>
Author Email: <?php the_author_email(); ?>
Author Bio: <?php the_author_description(); ?>
解决方法:
- How To: Adding An Author Page To Your WordPress Blog
- Using Author Template Tags Outside of the WordPress Loop
- Kafkaesquí’s Get Author Profile Plugin- 读取作者信息并能够展示出来,比如在侧边栏的博客拥有者介绍或博客的贡献者列表.
2. 在每篇文章下显示作者简介

如果你想像上面这样在文章页面显示作者简介和头像, 方法如下:
- Doing more with gravatars: Part 2- 如何在你的单个文章页放置一个基本的“About the Author”区域并且为每一个作者显示一个头像.
- How To Add Bio Info To Your WordPress Blog Posts
- Display Author Profile with Author Exposed
3. 分开作者的评论和其他人的评论
当你的博客有多个作者时,你将需要把作者的评论区单独列出来,可以使用下面的代码:
<li class=”<?php if ($comment->comment_author_email == “authorname@domain.com”) echo ‘author’; else if ($comment->comment_author_email == “anotherauthorname@domain.com”) echo ‘author2′; else if ($comment->comment_author_email == “thirdauthorname@domain.com”) echo ‘author3′; else echo $oddcomment; ?> item” id=”comment-<?php comment_ID() ?>”>
原文地址http://www.noupe.com/wordpress/most-desired-wordpress-hacks-11-common-requests-and-fixes.html
来自:http://nufeng.cn/wordpress-post-author-related-solutions/

