the_author_link()
Display either author's link or author's name.
If the author has a home page set, echo an HTML link, otherwise just echo the author's name.
Uses: get_the_author_link()
1 time — 0.000045 sec (very fast) | 50000 times — 0.28 sec (very fast) | PHP 7.1.2, WP 4.7.3
No Hooks.
Return
null
. Nothing (null).
Usage
the_author_link();
Examples
#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() the author link code WP 6.7.1
function the_author_link() { echo get_the_author_link(); }