Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Date query – Feb to Nov but not May

In 2016, between February-November, but not on May.

$date_query = array(
	'relation' => 'AND',
	array(
		'year'          => 2016,
	),
	array(
		'month'         => 2,
		'compare'       => '>=',
	),
	array(
		'month'         => 11,
		'compare'       => '<=',
	),
	array(
		'month'         => 5,
		'compare'       => '!=',
	),
);