WordPress: Template Tags/wp list authors:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: == Description == Displays a list of the blog's authors (users), and if the user has authored any posts, the author name is displayed as a link to their posts. Optionally this tag displ...)
 
无编辑摘要
第1行: 第1行:
== Description ==
== Description ==
==描述 ==


Displays a list of the blog's authors (users), and if the user has authored any posts, the author name is displayed as a link to their posts.  Optionally this tag displays each author's post count and [[WordPress:Glossary#RSS|RSS]] feed link.  
Displays a list of the blog's authors (users), and if the user has authored any posts, the author name is displayed as a link to their posts.  Optionally this tag displays each author's post count and [[WordPress:Glossary#RSS|RSS]] feed link.  
显示一个博客作者(用户)的列表,如果用户写了一些文章,用户名会以一个链接的方式显示,链接到用户所写的文章。这个标签随意地显示每个作者的文章数目和[[WordPress:Glossary#RSS|RSS]] feed链接。


== Usage ==
== Usage ==
== 用法==
%%% <?php wp_list_authors('arguments'); ?> %%%


%%% <?php wp_list_authors('arguments'); ?> %%%
%%% <?php wp_list_authors('arguments'); ?> %%%


== Examples ==
== Examples ==
==例子 ==


===Default Usage===
===Default Usage===
===默认用法===
<pre>
$defaults = array('optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false,
  'hide_empty' => true,'feed' => '', 'feed_image' => '');</pre>
<pre>
<pre>
$defaults = array('optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false,
$defaults = array('optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false,
第15行: 第30行:


By default, the usage shows:
By default, the usage shows:
默认情况下,用法显示为:
* Does not display the count of the number of posts
* Does not display the count of the number of posts
*不显示文章的数目。
* Excludes the 'admin' author from the list
* Excludes the 'admin' author from the list
*从列表中移除'管理'作者
* Does not display the full name (first and last) but displays the author nickname
* Does not display the full name (first and last) but displays the author nickname
*不显示全名(姓和名),但是显示作者的昵称
* Excludes users with no posts
* Excludes users with no posts
*删除没有文章的作者
* No author feed text is displayed
* No author feed text is displayed
*不显示作者feed文本
* No author feed image is displayed
* No author feed image is displayed
*不显示作者feed图像


  <?php wp_list_authors(); ?>
  <?php wp_list_authors(); ?>
<?php wp_list_authors(); ?>


=== Authors Full Names and Number of Posts ===
=== Authors Full Names and Number of Posts ===
=== 作者全名和文章数目===


This example displays a list of the site's authors with the full name (first and last name) plus the number of posts for each author.  Also, and by default, it excludes the admin author, hides authors with no posts, and does not display the RSS feed or image.
This example displays a list of the site's authors with the full name (first and last name) plus the number of posts for each author.  Also, and by default, it excludes the admin author, hides authors with no posts, and does not display the RSS feed or image.
 
这个列表现在作者的全名(姓和名)和每个作者所写的文章数目。同时,默认情况下,列表删除了管理作者,隐藏了没写文章的作者,同时不显示RSS feed或者图像。
 
  <?php wp_list_authors('show_fullname=1&optioncount=1'); ?>
  <?php wp_list_authors('show_fullname=1&optioncount=1'); ?>
<?php wp_list_authors('show_fullname=1&optioncount=1'); ?>
<div style="border:1px solid blue; width:50%; padding:10px">Harriett Smith (42)<br />
Sally Smith (29)<br />
Andrew Anderson (48)</div>


<div style="border:1px solid blue; width:50%; padding:10px">Harriett Smith (42)<br />
<div style="border:1px solid blue; width:50%; padding:10px">Harriett Smith (42)<br />
第35行: 第76行:


== Parameters ==
== Parameters ==
== 参数==


; optioncount : (''boolean'') Display number of published posts by each author. Options are:
; optioncount : (''boolean'') Display number of published posts by each author. Options are:
; optioncount : (''boolean'')显示每个作者发表的文章的数目。选项是:
:* <tt>1</tt> (true)
:* <tt>1</tt> (true)
:* <tt>0</tt> (false - this is the default)  
:* <tt>0</tt> (false - this is the default)  
第42行: 第88行:
:* <tt>1</tt> (true - this is the default)
:* <tt>1</tt> (true - this is the default)
:* <code>0</code> (false)  
:* <code>0</code> (false)  
:* <tt>1</tt> (真的)
:* <tt>0</tt> (假的 – 这是默认的)
; 排除_管理 : (''boolean'') 从作者列表上排除'管理' (以管理帐户登录)帐户。选项是:
:* <tt>1</tt> (真的 – 这是默认的)
:* <code>0</code> (假的)
; show_fullname : (''boolean'') Display the full (first and last) name of the authors. If false, the nickname is displayed. Options are:
; show_fullname : (''boolean'') Display the full (first and last) name of the authors. If false, the nickname is displayed. Options are:
;显示_全名:(''boolean'')显示文章作者的全名(姓和名)。如果是错误的,显示昵称。选项是:
:* <tt>1</tt> (true)
:* <tt>1</tt> (true)
:* <tt>0</tt> (false - this is the default)  
:* <tt>0</tt> (false - this is the default)  
第48行: 第106行:
:* <tt>1</tt> (true - this is the default)
:* <tt>1</tt> (true - this is the default)
:* <tt>0</tt> (false)  
:* <tt>0</tt> (false)  
:* <tt>1</tt> (真确的)
:* <tt>0</tt> (错误的 – 这是默认的)
; 隐藏_空的 : (''boolean'') 不显示没写文章的作者。选项是:
:* <tt>1</tt> (真的 –这是默认的)
:* <tt>0</tt> (错误的)
; feed : (''string'') Text to display for a link to each author's RSS feed. Default is no text, and no feed displayed.
; feed : (''string'') Text to display for a link to each author's RSS feed. Default is no text, and no feed displayed.
; feed : (''string'')文本显示连接到每个作者的RSS feed的链接。
默认是没有文章,而且没有显示feed。
; feed_image : (''string'') Path/filename for a graphic. This acts as a link to each author's RSS feed, and overrides the '''feed''' parameter.
; feed_image : (''string'') Path/filename for a graphic. This acts as a link to each author's RSS feed, and overrides the '''feed''' parameter.
; feed_image : (''string'') 一个图形的路径/文件名。这个作为每个作者的RSS feed的链接,而且覆盖了'''feed''' 参数。


== Related ==
== Related ==
== 相关的 ==


{{Tag Author Tags}}
{{Tag Author Tags}}


{{Query String Tag Footer}}
{{Query String Tag Footer}}
{{标签 作者标签}}
{{查询 String标签 页底文字}}

2008年6月28日 (六) 17:04的版本

Description

描述

Displays a list of the blog's authors (users), and if the user has authored any posts, the author name is displayed as a link to their posts. Optionally this tag displays each author's post count and RSS feed link.

显示一个博客作者(用户)的列表,如果用户写了一些文章,用户名会以一个链接的方式显示,链接到用户所写的文章。这个标签随意地显示每个作者的文章数目和RSS feed链接。

Usage

用法

%%% <?php wp_list_authors('arguments'); ?> %%%

%%% <?php wp_list_authors('arguments'); ?> %%%

Examples

例子

Default Usage

默认用法

$defaults = array('optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false,
   'hide_empty' => true,'feed' => '', 'feed_image' => '');
$defaults = array('optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false,
   'hide_empty' => true,'feed' => '', 'feed_image' => '');

By default, the usage shows: 默认情况下,用法显示为:

  • Does not display the count of the number of posts
  • 不显示文章的数目。
  • Excludes the 'admin' author from the list
  • 从列表中移除'管理'作者
  • Does not display the full name (first and last) but displays the author nickname
  • 不显示全名(姓和名),但是显示作者的昵称
  • Excludes users with no posts
  • 删除没有文章的作者
  • No author feed text is displayed
  • 不显示作者feed文本
  • No author feed image is displayed
  • 不显示作者feed图像
<?php wp_list_authors(); ?>

<?php wp_list_authors(); ?>

Authors Full Names and Number of Posts

作者全名和文章数目

This example displays a list of the site's authors with the full name (first and last name) plus the number of posts for each author. Also, and by default, it excludes the admin author, hides authors with no posts, and does not display the RSS feed or image.

这个列表现在作者的全名(姓和名)和每个作者所写的文章数目。同时,默认情况下,列表删除了管理作者,隐藏了没写文章的作者,同时不显示RSS feed或者图像。

<?php wp_list_authors('show_fullname=1&optioncount=1'); ?>

<?php wp_list_authors('show_fullname=1&optioncount=1'); ?>

Harriett Smith (42)

Sally Smith (29)

Andrew Anderson (48)
Harriett Smith (42)

Sally Smith (29)

Andrew Anderson (48)

Parameters

参数

optioncount
(boolean) Display number of published posts by each author. Options are:
optioncount
(boolean)显示每个作者发表的文章的数目。选项是:
  • 1 (true)
  • 0 (false - this is the default)
exclude_admin
(boolean) Exclude the 'admin' (login is admin) account from authors list. Options are:
  • 1 (true - this is the default)
  • 0 (false)


  • 1 (真的)
  • 0 (假的 – 这是默认的)
排除_管理
(boolean) 从作者列表上排除'管理' (以管理帐户登录)帐户。选项是:
  • 1 (真的 – 这是默认的)
  • 0 (假的)


show_fullname
(boolean) Display the full (first and last) name of the authors. If false, the nickname is displayed. Options are:

;显示_全名:(boolean)显示文章作者的全名(姓和名)。如果是错误的,显示昵称。选项是:

  • 1 (true)
  • 0 (false - this is the default)
hide_empty
(boolean) Do not display authors with 0 posts. Options are:
  • 1 (true - this is the default)
  • 0 (false)


  • 1 (真确的)
  • 0 (错误的 – 这是默认的)
隐藏_空的
(boolean) 不显示没写文章的作者。选项是:
  • 1 (真的 –这是默认的)
  • 0 (错误的)


feed
(string) Text to display for a link to each author's RSS feed. Default is no text, and no feed displayed.
feed
(string)文本显示连接到每个作者的RSS feed的链接。

默认是没有文章,而且没有显示feed。

feed_image
(string) Path/filename for a graphic. This acts as a link to each author's RSS feed, and overrides the feed parameter.
feed_image
(string) 一个图形的路径/文件名。这个作为每个作者的RSS feed的链接,而且覆盖了feed 参数。

Related

相关的

模板:Tag Author Tags

模板:Query String Tag Footer 模板:标签 作者标签

模板:查询 String标签 页底文字