Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

carousel

Check post meta for use_in_carousel

$meta_query = array(
	array(
		'key'     => 'use_in_carousel',
		'value'   => '1',
		'type'    => 'BINARY',
	),
);