How to get post author name by its ID inside a function?

The echoing is already done by the_author_meta().

echo $autor_name does nothing.

Correct would be to use get_the_author_meta().

Leave a Comment