WordPress at a glance

the_author() WP 0.71

Display the name of the author of the current post.

Must be used inside WordPress Loop.

The behavior of this function is based on old functionality predating get_the_author(). This function is not deprecated but is designed to echo the value from get_the_author() and as a result of any old theme that might still use the old behavior will also pass the value from get_the_author().

The normal, expected behavior of this function is to echo the author and not return it. If you need return the value to use further in php use get_the_author().

Works based on: get_the_author()
1 time = 0.000044s = very fast | 50000 times = 0.49s = very fast | PHP 7.1.2, WP 4.7.3

No Hooks.


null/string. Display author name.


<?php the_author(); ?>

Old usage:

<?php the_author( $deprecated, $deprecated_echo ); ?>
Default: ''
Deprecated. Use get_the_author(). Echo the string or return it.
Default: true


#1 Output the public name of the author of the post in the WordPress cycle

The public name is specified in the setting: "display as"

<p>The author of the post: <?php the_author(); ?></p>

#2 Get the author's name using the get_the_author() function:

$author = get_the_author();
echo "The author of the post: ". $author;


  • See: get_the_author()

Список изменений

С версии 0.71 Введена.

Code of the_author() WP 5.5.1

function the_author( $deprecated = '', $deprecated_echo = true ) {
	if ( ! empty( $deprecated ) ) {
		_deprecated_argument( __FUNCTION__, '2.1.0' );

	if ( true !== $deprecated_echo ) {
				/* translators: %s: get_the_author() */
				__( 'Use %s instead if you do not want the value echoed.' ),

	if ( $deprecated_echo ) {
		echo get_the_author();

	return get_the_author();

Related Functions

From tag: WP Loop

More from category: Posts, pages...

More from Template Tags: Authors

vladlu 100vlad.lu
Editors: kama 100
No comments
    Log In . Register