Example 1 — Basic link
Print the author archive link.
<?php the_author_posts_link(); ?> How It Works
- WordPress finds the author archive URL.
- It prints an
<a>tag with the display name. - The
titlesays "Posts by" and the name.

In WordPress, the_author_posts_link() prints a link to the author archive page. The link text is the author display name.
The archive page lists all posts by that author. Use this tag inside The Loop. To get the HTML as a string, use get_the_author_posts_link().
Call it with no arguments inside The Loop.
the_author_posts_link(); | Call | What it does |
|---|---|
the_author_posts_link() | Prints a link to the archive of the current post author. |
No echo is needed. If you want only the URL, use get_author_posts_url().
the_author_posts_link( string $deprecated = '' ): void | Parameter | Description |
|---|---|
$deprecated | Optional. Unused. Do not pass it. |
| Return Value | Description |
|---|---|
| void (prints to the page) | The function prints the link. Its twin get_the_author_posts_link() returns it. |
Three short theme examples. Each one has a sample output.
Print the author archive link.
<?php the_author_posts_link(); ?> <a> tag with the display name.title says "Posts by" and the name.Use the link in a post byline.
<p class="byline">
More from <?php the_author_posts_link(); ?>
</p> the_author_posts_link() prints the link.Store the link when you want to place it in a string.
<?php
$link = get_the_author_posts_link();
echo '<p>Author: ' . $link . '</p>';
?> get_the_author_posts_link() returns the link HTML.echo.Print a list of all authors on your site.
9 people found this page helpful