WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/is author

Contents

Description

This Conditional Tag checks if an Author archive page is being displayed. This is a boolean function, meaning it returns either TRUE or FALSE.

Usage

<?php is_author($author); ?>

Parameters

$author
(mixed) (optional) Author ID or Author Nickname
Default: None

Return Values

(boolean) 
True on success, false on failure.

Examples

is_author();
// When any Author page is being displayed.

is_author('4');
// When the archive page for Author number (ID) 4 is being displayed.

is_author('Vivian');
// When the archive page for the Author with Nickname "Vivian" is being displayed.

is_author('john-jones');
// When the archive page for the Author with Nicename "john-jones" is being displayed.

is_author(array(4,'john-jones','Vivian'));
// When the archive page for the author is either user ID 4, or user_nicename "john-jones", or nickname "Vivian".  Note: the array ability was added at Version 2.5.

Notes

Change Log

Since: Version 1.5

Source File

is_author() is located in wp-includes/query.php.

Related

See also index of Function Reference and index of Template Tags.