wordpress显示作者信息

作者:matrix 被围观: 4,406 次 发布时间:2013-06-22 分类:Wordpress 兼容并蓄 | 无评论 »

这是一个创建于 3932 天前的主题,其中的信息可能已经有所发展或是发生改变。

WordPress显示作者信息适用于多作者的博客。在文章末尾显示作者信息 效果不错。

只需要在函数模版functions.php里添加下面代码:

add_filter('the_content','webzty_author_meta');  
 function webzty_author_meta($content){  
 if(is_singular()){  
 $id=get_the_author_meta('ID');  
 $avatar='<div style="float:left;margin-right:5px;">'.get_avatar($id,64).'</div>';  
 $author='<div style="float:left"><div>作者: '.get_the_author_meta('display_name').'</div>';  
 $des='<div>'.get_the_author_meta('user_description').'</div></div><div style="clear:both"></div>';  
 $content=$content.$avatar.$author.$des;  
 }  
 return $content;  
 }  

效果如图,会在文章末尾显示。带有头像,不错~
wordpress显示作者信息
参考:http://www.ztyhome.com/wordpress-author-detail

其他文章:
本文固定链接:https://www.hhtjim.com/wordpress-displays-the-author-information.html
matrix
本文章由 matrix 于2013年06月22日发布在Wordpress, 兼容并蓄分类下,目前没有通告,你可以至底部留下评论。
转载请注明:wordpress显示作者信息-HHTjim'S 部落格
关键字:

添加新评论 »

 🙈 😱 😂 😛 😭 😳 😀 😆 👿 😉 😯 😮 😕 😎 😐 😥 😡 😈 💡

插入图片

NOTICE: You should type some Chinese word (like “你好”) in your comment to pass the spam-check, thanks for your patience!