I’ve already shown you how to make a contributors page template which lists all members assigned the contributors role but how about individual authors?
This tutorial includes all the PHP code as well as some sample CSS you can use to design you own author.php template.
Here’s an example of the what it can look like using this code:
You can use this code to create a template for all authors or 1 specific author using the authors I.D or nicename.
Simply name your file using this guide:
- author-nicename.php – If the author’s nice name were bob, you would name your file author-bob.php.
- author-id.php – If the author’s ID were 007, you would name your file author-007.php.
- author.php – Use this file name if you want to use the template for all authors.
Example Template File
You need to subscribe to fully access this tutorial.
No doubt you could consolidate the CSS and spend more time on the styling to make this page look really impressive.
The PHP code in the Gist labelled author.php is a modified version of the sample template file on the WordPress Codex.
- Copy this code from the view raw link in the Gist labelled author.php and paste it into a new file using a code editor like Notepad++. This file should be added to the root directory of your child theme.
- You will also need to add the code which adds more fields to each users profile edit screen and paste it at the end of your child themes functions.php file.
- The 3rd Gist contains CSS code which you can paste at the end of your child themes style.css file.