the_author_link()WP 2.1.0

Outputs the HTML code for a link to the author's site.

The site is set in the user's profile settings. The link text will be "display name".

This Template Tag should be used inside the WordPress Loop.

1 time — 0.000045 sec (very fast) | 50000 times — 0.28 sec (very fast) | PHP 7.1.2, WP 4.7.3

No Hooks.

Returns

null.

Usage

<?php the_author_link(); ?>

Examples

0

#1 Displays the author’s Website Link

Displays the author’s Website URL as a link and the text for the link is the author’s Profile Display name. In this example, the author’s Display Name is James Smith.

<p>Author posts: <?php the_author_link(); ?></p>

Get:

Author posts: <a href="https://smith_website_link">James Smith</a>

Changelog

Since 2.1.0 Introduced.

the_author_link() code WP 6.8.1

function the_author_link() {
	echo get_the_author_link();
}