Getting the author name on author archive page
I don’t know what are you trying to do with if-else statement, but to display author name with their published post link use this code: <span>Article posted by <?php the_author_posts_link(); ?></span> Tweak it according to your need. One more thing: You need to call the_author_posts_link() function within the while loop (Yes, the same while loop, … Read more