Customize the WordPress Author Page Template for The7 Theme
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 the WordPress Author Page Using CSS
The next step is to style the WordPress author page. 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 do the following:
- Display the avatar as a rounded image
- Center the avatar and bio
- 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.
Final Thoughts
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.
For more information about The7 theme:
Need help? Our WordPress Development Service is a comprehensive solution for small, medium, and enterprise-level businesses. Call us at 602-633-4758 for a free consultation.