Show biographies for co-authors at the end of your post

In the WordPress.org forums, doubleedesign says:

I want to add the authors’ biographies to the end of each post.

Awesome… it’s pretty simple to do. Conceptually, what we need to do is load our co-authors, and then loop through printing the relevant information for each one.

You’ll want to put the following code snippet within The Loop in any template you’d like the bios to appear.

[sourcecode language=“php”] /** * Show multiple Co-Author biography fields at the bottom of a single post * This snippet should be placed within The Loop */ if ( class_exists( ‘coauthors_plus’ ) ) { // Get the Co-Authors for the post $co_authors = get_coauthors(); // For each Co-Author, echo a wrapper div, their name, and their bio if they have one foreach ( $co_authors as $key => $co_author ) { $co_author_classes = array( ‘co-author-wrap’, ‘co-author-number-’ . ( $key + 1 ), ); echo ‘

’; echo ‘

’ . $co_author->display_name . ‘

’; // Only print the description if the description exists if ( $description = get_the_author_meta( ‘description’, $co_author->ID ) ) echo ‘

’ . $description . ‘

’; echo ‘
’; } } [/sourcecode]

If you’d like other co-author details to appear as well, like their avatar for instance, you can modify the output within the foreach loop.