$tf_custom_query
// WP_Query arguments
$args = array(
'post_type' => array( 'perf' ),
'post_status' => array( 'publish' ),
'nopaging' => true,
'posts_per_page' => '-1',
'posts_per_archive_page' => '-1',
'order' => 'DESC',
'orderby' => 'rand',
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'location',
'field' => 'term_id',
'operator' => 'IN',
'include_children' => true,
),
array(
'taxonomy' => 'type',
'field' => 'term_id',
'operator' => 'IN',
'include_children' => false,
),
),
'cache_results' => true,
'update_post_meta_cache' => false,
'update_post_term_cache' => true,
);
// The Query
$tp_query = new WP_Query( $args );
// The Loop
if ( $tp_query->have_posts() ) {
while ( $tp_query->have_posts() ) {
$tp_query->the_post();
// do something
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();