get_the_author_posts_link()
Gets the HTML code for a link to the author's post archive page. The link text will be the "displayed" name of the author. This template tag should be used inside the WordPress Loop.
Use the_author_posts_link() when you need to immediately display the result on the screen.
Used By: the_author_posts_link()
1 time — 0.014242 sec (extremely slow) | 50000 times — 5.91 sec (fast) | PHP 7.1.11, WP 4.9.8
Hooks from the function
Returns
String. A string, the HTML code for the link to the author's archive page of the current post.
Usage
get_the_author_posts_link();
Examples
#1 Display a link to the author's archive page
The link text will be the author's name:
<p>Other author's posts: <?= get_the_author_posts_link() ?></p>
This displays:
<p>Other posts by the author: <a href="/author/kama" title="Kama posts" rel="author">Kama</a></p>
The the_author_posts_link() function does the same. Only it will immediately output the result without echo.
Notes
- Global. WP_User.
$authordataThe current author's data.
Changelog
| Since 4.4.0 | Introduced. |