Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

single unit

// WP_Query arguments
$args = array(
	'post_type'              => array( 'unit' ),
	'post_status'            => array( 'publish' ),
	'meta_query'             => array(
		array(
			'key'     => 'id',
			'value'   => ''unit_id'',
			'compare' => '=',
		),
	),
);

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