preloader

How to Display Co-Author Bylines in Your WordPress Theme

Co-Authors Plus stores multiple authors per post, but your theme needs to be updated to display them. Most themes use the standard WordPress get_the_author() function which only returns one author. Here is how to replace that with Co-Authors Plus template tags.

The Problem with Default Theme Author Display

Your theme probably has code like this in single.php or content.php:

<?php the_author(); ?>
<!-- or -->
<?php echo get_the_author(); ?>
<!-- or -->
<?php echo get_the_author_meta( 'display_name' ); ?>

All of these only return the primary registered author. Co-Authors Plus provides replacement functions.

Basic Byline with Linked Author Names

The simplest replacement is coauthors_posts_links() which outputs all author names as comma-separated links to their author archive pages:

// Replace the_author() or get_the_author() with:
<?php if ( function_exists( 'coauthors_posts_links' ) ) {
    coauthors_posts_links();
} else {
    the_author();
} ?>

The conditional check ensures your theme does not break if Co-Authors Plus is ever deactivated.

Byline with Custom Separators

coauthors_posts_links() accepts parameters for between, before last, and after last separators:

<?php
coauthors_posts_links(
    ', ',    // between authors
    ' and ', // before the last author
    '',      // before the list
    '',      // after the list
    true     // echo output (false to return as string)
);
?>

This outputs “Jane Smith, John Doe and Alice Brown” for a three-author post.

Plain Text Byline (No Links)

Use coauthors() for plain text without archive page links:

<?php coauthors( ', ', ' and ' ); ?>

Looping Through Authors for Custom Display

For a fully custom byline display — showing each author’s avatar, name, and bio separately — loop through the authors array:

<?php
$authors = get_coauthors();
foreach ( $authors as $author ) : ?>
    <div class="author-credit">
        <?php echo get_avatar( $author->user_email, 48 ); ?>
        <div class="author-info">
            <a href="<?php echo get_author_posts_url( $author->ID, $author->user_nicename ); ?>">
                <?php echo esc_html( $author->display_name ); ?>
            </a>
            <p><?php echo esc_html( $author->description ); ?></p>
        </div>
    </div>
<?php endforeach; ?>

Showing Co-Authors in the Loop (Archive Pages)

For archive pages where multiple posts are listed, use the same functions inside the loop. coauthors_posts_links() is context-aware and automatically reads the current post in the loop without needing to pass a post ID.

Adding Co-Author Support to Custom Post Types

By default Co-Authors Plus supports posts and pages. To add support for a custom post type, go to Settings, then Co-Authors, and add the post type slug. After saving, the co-author meta box appears when editing that post type and the template tag functions work correctly on its archive and single templates.

For theme integration beyond template tags — including custom author archive templates and schema markup for multiple authors — a WordPress developer can implement the full Co-Authors Plus setup in your theme.

Keep Reading

Previous Post Gutenberg Full Site Editing: Practical Guide for Classic Theme Users Next Post Co-Authors Plus and SEO: Managing Author Archives and Schema

Need Help With Your WordPress Site?

If you need help with WordPress fixes, plugin issues, theme customization, or development work, feel free to get in touch.

Get a Free Estimate