FacetWP + Co-Authors Plus

mgibbs189

{{gist file=”gistfile1.php” lang=”php”}}
<?php

$args = array(
‘posts_per_page’ => -1,
‘post_type’ => ‘bookshelf’,
‘post_status’ => ‘publish’,
‘tax_query’ => array( // Query on the “Co-Authors Plus” custom taxonomy
array(
‘taxonomy’ => ‘author’,
‘terms’ => $author // the author ID
)
)
);

// The Query
$the_query = new WP_Query( $args );

// The Loop
if ( $the_query->have_posts() ) {
echo ‘<div class=”masonry-item”><h2>Bookshelf</h2>’;
echo ‘<ul>’;
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo ‘<li>’;
echo ‘<a href=”‘.get_permalink().'”>’.get_the_title().'</a>’;
echo ‘</li>’;
}
echo ‘</ul></div>’;
}

wp_reset_postdata();

{{/gist}}