Author Contributors Page Template

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

genesis sample theme

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.

  1. 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.
  2. Copy the PHP from the Gist labelled functions.php and paste it at the end of your child themes functions.php file.
  3. 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.

Similar Posts


Comments

12 responses to “Author Contributors Page Template”

  1. […] Want something styled? Try this wpsites.net/web-design/author-contributors-page-template […]

  2. Matthew Avatar

    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.

    1. Brad Dalton Avatar
      Brad Dalton

      Change the value for the max-width to something like this depending on which theme you’re using.

      [code]
      .contributor-info {
      margin: 0 auto;
      max-width: 1000px;
      }
      [/code]

  3. Brandon Carter Avatar
    Brandon Carter

    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.

    1. Brad Dalton Avatar
      Brad Dalton

      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.

      1. Brandon Avatar

        Ah, gotcha. I’ll give it another shot. Thanks!

  4. mariedenee Avatar
    mariedenee

    If we wanted to add their social media profiles for Genesis, where/how would you do this?

    1. Brad Dalton Avatar
      Brad Dalton

      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.

  5. Awww I made the cut! Thanks Brad and I need this for a new project. You must have been reading my mind!

    1. Brad Dalton Avatar
      Brad Dalton

      I owe you but still would have anyway.

  6. Keith Davis Avatar
    Keith Davis

    Thanks for the feature Brad.
    Gave you a share on Facebook.

    1. Brad Dalton Avatar
      Brad Dalton

      Prefer a link!! hahaha.

      Just kidding.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.