3 November 2014

Display author meta for authors without posts in WordPress

When creating an author template in WordPress, it’s normally quite straightforward  to retrieve author meta. You can use WP’s author template tags such as:

For a complete list of these, see the Codex.

However, if the author has no posts in the database these tags will not work unless you also supply the author’s ID. A simple way to get this is by using:

This retrieves the ID of the currently displayed author page.

You can now pass this into the template tags, for example: