job query
// WP_Query arguments
$args = array(
'post_type' => array( 'jobs' ),
'post_status' => array( 'publish' ),
's' => 'keyword',
'nopaging' => true,
'posts_per_page' => '999',
'ignore_sticky_posts' => false,
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'job_category',
'terms' => array( 'a', 'b', 'c' ),
'field' => 'name',
'operator' => 'IN',
'include_children' => true,
),
array(
'taxonomy' => 'job_location',
'terms' => array( 'loc1', 'loc2' ),
'field' => 'name',
'operator' => 'IN',
'include_children' => true,
),
array(
'taxonomy' => 'hob_tag',
'terms' => array( 'tag1', ' tag2' ),
'field' => 'name',
'operator' => 'IN',
'include_children' => true,
),
),
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'metkey',
'value' => 'metval',
'compare' => '=',
),
array(
'key' => 'metkey2',
'value' => 'metval2',
'compare' => '=',
),
),
);
// The Query
$query = new WP_Query( $args );
// The Loop
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
// do something
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();