How to Add Author Name to Author Archive
Hi everybody. Yes we will add author name to archive, admin/editor/publisher archive pages show their name like “Author archive for (author name)”. Lets begin…
First, open your archive.php from your theme folder. This is a sample code, it can be different in your theme.
Find
< ?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2>Author Archive for</h2>
And replace with;
< ?php /* If this is an author archive */ } elseif (is_author()) { ?>
< ?php $author = get_userdata( get_query_var('author') );?>
<h2>Author Archive for < ?php echo $author->display_name;?></h2>
After you apply this code the author archive page title will change like “Archive for (author name)“.
That code different in my theme. If you click my avatar in the bottom of this post, you call my author archive page and again you can see author name in the bottom of page.
That’s All! Have a nice day!
