Skip to content

Instantly share code, notes, and snippets.

@kellenmace
Created September 7, 2015 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kellenmace/de9af863689faeea6395 to your computer and use it in GitHub Desktop.
Save kellenmace/de9af863689faeea6395 to your computer and use it in GitHub Desktop.
<?php
// get all 'staff' post types with a taxonomy term of 'executive_committee'
$staff = new WP_Query( array (
'post_type' => 'staff',
'posts_per_page' => 500,
'tax_query' => array(
array(
'taxonomy' => 'include_staff_on_page',
'field' => 'slug',
'terms' => 'executive_committee',
),
),
) );
if ( $staff->have_posts() ) : while ( $staff->have_posts() ) : $staff->the_post();
get_template_part( 'partials/content', 'staff-listing' );
endwhile; endif;
wp_reset_postdata();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment