If you feature multiple authors for your blog, or you just want to spruce up how the author archive looks, you may have noticed that there aren’t many options baked into The7 theme to customize the author archive template. For example, you may want to add the author avatar and bio to the top of the archive. This tutorial will show you how to customize the WordPress author page template for The7 theme without directly editing template files.
Step 1: Use the WordPress Filter get_the_archive_description
In order to insert the author avatar image and author bio into the description content, the WordPress filter get_the_archive_description will be used instead of directly editing The7 theme template files. Copy and paste the below code snippet into your child theme’s functions.php file.
If you would like to change the size of the avatar image, you can do so by editing the call to the function get_avatar_url on line 10. The default avatar size is 96. The code snippet is using 150.
Step 2: Style Using CSS
The next step is to copy and paste the code below into the style.css file located in your child theme’s directory. The customized CSS in this example will display the avatar as a rounded image, center the avatar and bio, and add a background color.
Take a look at our author archive page on this blog if you’d like to see an example of how this code functions and looks.
These two code snippets are written to work with The7 theme. If you decide to use the code snippets in another theme, keep in mind that the CSS may not be compatible, and you will have to rewrite it.