Add Multiple Authors to a Blog Post

This article was originally published in January 2011. I updated it in November 2012 to reflect new features added since then. A follow-up article by David Gray was published in September 2014 and may be useful as well.

If your WordPress site behaves like an online magazine, you may need to attribute a single post to multiple authors. The Co-Authors Plus plugin makes this straightforward by allowing multiple bylines for a post. Once the plugin is active you can use its template tags or call the get_coauthors() function to retrieve full author objects and render them wherever you need.

Authors Shortcode

Genesis theme users can customize the Post Info area via a filter. Instead of hard-coding coauthors_posts_links(), it’s often cleaner to create a shortcode that outputs linked author names. The shortcode can fall back to the single-author link when Co-Authors Plus is not available. Below is a compact shortcode implementation that supports a few attributes for flexible formatting:

Shortcode name: [post_authors_post_link] with attributes:

  • between — text displayed between author names (default: comma)
  • between_last — text displayed between the last two authors (default: “and”)
  • before — text inserted before the entire author list
  • after — text inserted after the entire author list

Add this code to your theme’s functions.php or to a site functionality plugin to register the shortcode:

/**
 * Post Authors Post Link Shortcode
 *
 * @param array $atts
 * @return string
 */
function be_post_authors_post_link_shortcode( $atts ) {

    $atts = shortcode_atts( array(
        'between'      => null,
        'between_last' => null,
        'before'       => null,
        'after'        => null
    ), $atts );

    // If Co-Authors Plus exists, use its output. Otherwise, build a basic author link.
    if ( function_exists( 'coauthors_posts_links' ) ) {
        $authors = coauthors_posts_links( $atts['between'], $atts['between_last'], $atts['before'], $atts['after'], false );
    } else {
        $author_url = get_author_posts_url( get_the_author_meta( 'ID' ) );
        $authors = $atts['before'] . '' . esc_html( get_the_author_meta( 'display_name' ) ) . '' . $atts['after'];
    }

    return $authors;
}
add_shortcode( 'post_authors_post_link', 'be_post_authors_post_link_shortcode' );

To make Genesis display “by” before the author list in Post Info, add a simple filter that returns the shortcode. Place this in functions.php or your functionality plugin:

/**
 * Use the post authors shortcode in Genesis Post Info
 */
function be_post_info( $info ) {
    $info = '[post_authors_post_link before="by "]';
    return $info;
}
add_filter( 'genesis_post_info', 'be_post_info' );

Author Boxes

Genesis includes an Author Box that appears at the end of single posts, but by default it displays only the post’s primary author. If you use Co-Authors Plus, you’ll want an author box for each co-author. The approach is:

  1. Remove the default Genesis author box.
  2. Create a reusable author-box renderer that accepts an author ID.
  3. Detect whether Co-Authors Plus is active; if so render a box for every co-author; if not, render the single post author box.

The following example shows the key logic. It removes the Genesis author box, adds a custom action to output one or more boxes, and defines two helper functions: one to loop authors and one to render a single author box by user ID:

// Remove Genesis Author Box and register our own
remove_action( 'genesis_after_post', 'genesis_do_author_box_single' );
add_action( 'genesis_after_post', 'be_author_box' );

/**
 * Load Author Boxes
 */
function be_author_box() {
    if ( ! is_single() ) {
        return;
    }

    if ( function_exists( 'get_coauthors' ) ) {
        $authors = get_coauthors();
        foreach ( $authors as $author ) {
            be_do_author_box( $author->data->ID );
        }
    } else {
        be_do_author_box( get_the_author_meta( 'ID' ) );
    }
}

/**
 * Display a single author box (modified from Genesis to accept an ID)
 */
function be_do_author_box( $id = false ) {
    if ( ! $id ) {
        return;
    }

    $authordata    = get_userdata( $id );
    $gravatar_size = apply_filters( 'genesis_author_box_gravatar_size', 70 );
    $gravatar      = get_avatar( get_the_author_meta( 'user_email', $id ), $gravatar_size );
    $title         = apply_filters( 'genesis_author_box_title', sprintf( '%s %s', __( 'About', 'genesis' ), get_the_author_meta( 'display_name', $id ) ) );
    $description   = wpautop( get_the_author_meta( 'description', $id ) );

    $pattern = '
%s %s
%s
'; echo apply_filters( 'genesis_author_box', sprintf( $pattern, $gravatar, $title, $description ) ); }

With these changes in place, single posts will display an author box for each co-author when Co-Authors Plus is active. When the plugin is not present, the single post will continue to show the standard single-author box. This keeps your site robust and compatible regardless of plugin availability.

These solutions are intentionally minimal and focused on compatibility with Genesis and Co-Authors Plus. You can further customize markup, styling, and filters to match your theme and accessibility requirements.