When using Co-Authors Plus, you may want to create a listing of all posts by a given co-author. Co-Authors Plus deviates slightly from how core WordPress works in that it stores byline information in a custom ‘author’ taxonomy. It works in this manner because a post (let it be a Post, Page, or Custom Post Type) can have multiple taxonomy terms associated with it.
To list some or all posts from a co-author, you’ll want to create a new WP_Query object based on the author term for a given user or guest author. Here’s an example of what that might look like:
// Get the author term based on a variable called $user_login global $coauthors_plus; $coauthor = $coauthors_plus->get_coauthor_by( 'user_login', $user_login ); $coauthor_term = $coauthors_plus->get_author_term( $coauthor ); // Build the query arguments $args = array( 'post_type' => 'post', 'posts_per_page' => 10, 'post_status' => 'publish', 'tax_query' => array( array( 'taxonomy' => 'author', 'field' => 'slug', 'terms' => $coauthor_term->slug, ), ), ); $author_query = new WP_Query( $args ); if ( $author_query->have_posts() ) : while ( $author_query->have_posts() ) : $author_query->the_post(); // Do your presentation endwhile; endif;