Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Subsite Directory Query

// WP_Query arguments
$args = array(
	'post_type'              => array( 'people' ),
	'order'                  => 'ASC',
	'meta_query'             => array(
		'relation' => 'AND',
		array(
			'key'     => 'departments',
			'value'   => '19335',
			'compare' => '=',
			'type'    => 'NUMERIC',
		),
	),
);

// The Query
$subsite_directory = new WP_Query( $args );

// The Loop
if ( $subsite_directory->have_posts() ) {
	while ( $subsite_directory->have_posts() ) {
		$subsite_directory->the_post();
		// do something
	}
} else {
	// no posts found
}

// Restore original Post Data
wp_reset_postdata();