Example 1 — Basic use
Print the author link in a post.
<?php the_author_link(); ?> How It Works
- WordPress reads the website from the author profile.
- It prints an
<a>tag with the display name. - No
echois needed.

In WordPress, the_author_link() prints a link to the author's website. The link text is the display name.
If the author has no website, it prints only the name. It is the echo version of get_the_author_link().
Call it with no arguments inside The Loop.
the_author_link(); | Call | What it does |
|---|---|
the_author_link() | Prints the author link, or the plain name when there is no website. |
No echo is needed. Use get_the_author_link() if you need the HTML as a string.
the_author_link(): void | Parameter | Description |
|---|---|
| None | This function takes no arguments. It reads the author of the current post. |
| Return Value | Description |
|---|---|
| void (prints to the page) | The function prints the link. Its twin get_the_author_link() returns it. |
Three short theme examples. Each one has a sample output.
Print the author link in a post.
<?php the_author_link(); ?> <a> tag with the display name.echo is needed.Use it in a simple byline.
<p class="byline">Written by <?php the_author_link(); ?></p> the_author_link() prints the link.If the profile has no website, you only see the name.
<p class="byline">Written by <?php the_author_link(); ?></p> Print how many posts the current author has written.
9 people found this page helpful