author.php not showing content if Author has no Posts

I managed to work out the issue, so wanted to share in case others run into the same problem.

The issue was coming from get_the_author_meta() which only works if an author has posts assigned to them…

The solution was to change the code to:

$author = get_user_by( 'slug', get_query_var( 'author_name' ) );

Then grab the meta info:

$author->ID
$author->description
$author->display_name

etc

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)