Featured center query
// WP_Query arguments
$args = array(
'post_type' => array( 'center' ),
'nopaging' => true,
'posts_per_page' => '1',
'orderby' => 'rand',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'big_featured_image',
'compare' => 'EXISTS',
),
array(
'key' => 'website',
'compare' => 'EXISTS',
),
array(
'key' => 'description',
'value' => '.',
'compare' => 'LIKE',
),
),
);
// The Query
$featured_center = new WP_Query( $args );
// The Loop
if ( $featured_center->have_posts() ) {
while ( $featured_center->have_posts() ) {
$featured_center->the_post();
// do something
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();