This code creates a new page template which prints a list of all contributing authors who have published posts on your blog.
There’s 2 versions in this post, the first of which will work with any theme and the 2nd for Genesis only users.
Here’s the result tested on StudioPress themes.
Update: See also WP Authors Page Template With Social Media Links
The code will also work on non Genesis themes however may need some tweaking of the CSS.
Installing The Code
There’s 3 blocks of code which need to be installed.
- Create a new file named contributors_page.php using a text editor like Notepad++ and copy the code from the Gist labelled contributors_page.php into your new file. Save the file to desktop and upload to the root directory of your child theme.
- Copy the PHP from the Gist labelled functions.php and paste it at the end of your child themes functions.php file.
- Copy the CSS code from the Gist labelled style.css and paste it at the end of your child themes style.css file before the start of your Media Queries section.
Code For Any Theme
This code includes a body class named wpsites-authors which you can use in your style sheet for specific template styling.
What The Code Does
Basically, the functions code creates a template tag which you can use in any template or hook in using a custom function with conditional tags.
Credit to the people who worked on the Twenty Fourteen default theme for WordPress as this code is a modified version of whats included in that theme.
Thanks so much for this template!
Is there a way to get everything left justified though? Right now the default is centered on the page, but it looks funny with the way my header and footer works. I’d like all of the information about the authors to line up on the left of the page but can’t figure out which element to configure.
Change the value for the max-width to something like this depending on which theme you’re using.
Hi Brad, thanks for this. I think I’m doing something incorrectly. I’ve tried both versions on a couple different WP installs. Using the Genesis-only code, I get this error when publishing:
Then, when trying the “works for everyone” code, it only pulls in one profile (mine):
Any tips?
Thanks! Love the blog.
Hello Brandon
The Genesis only version includes the code for the template only. You also need to add the code for the functions file which creates the template tag included in the template, as well as the CSS.
The code only prints authors who have published at least one post who have been registered as contributors.
You can change the status for any author to contributor or modify the code so all authors are included.
Ah, gotcha. I’ll give it another shot. Thanks!
If we wanted to add their social media profiles for Genesis, where/how would you do this?
You would need to code that into the template or functions file for the template tag and pull it from their Profile settings.
Otherwise, there’s another solution linked to in the related posts.
Awww I made the cut! Thanks Brad and I need this for a new project. You must have been reading my mind!
I owe you but still would have anyway.
Thanks for the feature Brad.
Gave you a share on Facebook.
Prefer a link!! hahaha.
Just kidding.