WordPress.org

Codex

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

Function Reference/get the author

Description

Retrieve the post author's display name. This tag must be used within The Loop.

To get the post author's ID, use get_the_author_meta( 'ID' ).

To display a page for authors which have no posts, see this discussion.

Since WordPress 2.1 parameters are deprecated (not the function).

Usage

 <?php $author get_the_author(); ?> 

Parameters

$deprecated
(string) (optional) Deprecated.
Default: ''

Returns

(string) 
The author's display name.

Examples

Grab the Author's 'Public' Name

Grabs the value in the user's Display name publicly as field.

<?php $author = get_the_author(); ?>

Change Log

Since: 1.5.0

Source File

get_the_author() is located in wp-includes/author-template.php.

Related

the_author(), get_the_author(), get_the_author_id(), the_author_link(), get_the_author_link(), the_author_meta(), get_the_author_meta(), the_author_posts(), get_the_author_posts(), the_author_posts_link(), get_author_posts_url(), get_the_modified_author(), the_modified_author(), wp_dropdown_users(), wp_list_authors()

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