Created
September 26, 2014 13:05
-
-
Save mgibbs189/9ff66c05cc9c60a235a3 to your computer and use it in GitHub Desktop.
FacetWP + Co-Authors Plus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment