get author display name wordpress
Use the get_the_author()
function in WordPress to retrieve the display name of the author. This function returns the display name as a string. It can be used within The Loop to display information about the post's author.
Here is an example of how to use it:
$author_display_name = get_the_author();
echo 'This post was written by ' . $author_display_name;
When using this function, make sure it is being used within The Loop, which is a way to iterate through posts in a WordPress theme.