WordPress函数讲解-Author Template Tags

作者:     目录: CSS+HTML & PHP+MySQL     发表: 2009年11月25日

设计Wordpress主题涉及到很多函数,我们按字母排序进行了整理,并附有注释和讲解,开发者可以参考这些函数,希望可以加快你的开发进度。

作者模块标签函数集 Author Template Tags

  1. 获取文章作者的名称(Author)函数-<?php the_author(); ?>,无参数。
  2. 获取文章作者的描述(Description)函数-<?php the_author_description();?>,无参数。
  3. 获取用户的登陆名(Author Login)函数-<?php the_author_login();?>,无参数。
  4. 获取用户的名(Author First Name)函数-<?php the_author_firstname();?>,无参数。
  5. 获取用户的姓(Author LastName)函数-<?php the_author_lastname(); ?>,无参数。
  6. 获取用户的昵称(Author Nickname)函数-<?php the_author_nickname(); ?>,无参数。
  7. 获取作者的ID (Author ID)函数-<?php the_author_ID(); ?>,无参数。
  8. 获取作者的Email(Author Email)函数-<?php the_author_email(); ?>,无参数。
  9. 获取作者的URL(Author URL)函数<?php the_author_url(); ?>,无参数。
  10. 获取作者的网站链接(Author Link)函数<?php the_author_link(); ?>,无参数。
  11. 获取用户的Author AIM Screenname函数<?php the_author_aim(); ?>,无参数。
  12. 获取用户的Author Yahoo IM ID函数<?php the_author_yim(); ?>,无参数。
  13. 获取用户发表的文章数量(Author Posts)函数<?php the_author_posts(); ?>,无参数。
  14. 获取用户所有文章的链接(Author Posts Link)函数<?php the_author_posts_link(); ?>,无参数。
  15. 获取用户列表(Author List)函数<?php wp_list_authors(‘arguments’); ?>多参数。
    例如:<?php wp_list_authors(‘exclude_admin=1&show_fullname=0’); ?>
    参数说明
    optioncount:用户发表的文章数量
    <?php wp_list_authors(‘optioncount=1’); ?>
    exclude_admin:将管理员用户排除
    <?php wp_list_authors(‘exclude_admin=0’); ?>
    show_fullname:显示用户的姓和名
    <?php wp_list_authors(‘show_fullname=1’); ?>
    hide_empty:隐藏没有发表文章的用户信息
    <?php wp_list_authors(‘hide_empty=0’); ?>
    feed:以文字的形式显示RSS FEED 链接
    <?php wp_list_authors(‘feed=RSS’); ?>
    feed_image:以图片的新式显示RSS feed 链接
    <?php wp_list_authors(‘feed_image=images/picture.jpg’);?>

1 个评论

  1. 任鸟飞说道:

    如果有什么遗漏及错误,请大家帮忙指正。希望多多提建议,谢谢!

发表评论