Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

query w/meta

// WP_Query arguments
$args = array(
	'post_type'              => array( 'devices' ),
	'post_status'            => array( 'publish' ),
	'nopaging'               => true,
	'meta_query'             => array(
		'relation' => 'AND',
		array(
			'key'     => 'device_id',
			'value'   => '123',
			'compare' => '=',
		),
	),
	'cache_results'          => true,
	'update_post_meta_cache' => true,
);

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