Codex

Template Tags/wp list authors

Contents

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.

Usage

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

Examples

Default Usage

$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
  • No author feed image is displayed
<?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.

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

Sally Smith (29)

Andrew Anderson (48)

Parameters

optioncount 
(boolean) Display number of published posts by each author. Options are:
  • 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)
show_fullname 
(boolean) Display the full (first and last) name of the authors. If false, the nickname is displayed. Options are:
  • 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)
feed 
(string) Text to display for a link to each author's RSS feed. Default is no text, and no feed displayed.
feed_image 
(string) Path/filename for a graphic. This acts as a link to each author's RSS feed, and overrides the feed parameter.

Related

the_author, the_author_description, the_author_login, the_author_firstname, the_author_lastname, the_author_nickname, the_author_ID, the_author_email, the_author_url, the_author_link, the_author_icq, the_author_aim, the_author_yim, the_author_msn, the_author_posts, the_author_posts_link, list_authors, wp_list_authors

How to pass parameters to tags with query-string-style parameters

Go to Template Tag index