Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Offre d’emploi Query

// WP_Query arguments
$args = array(
	'post_type'              => array( 'offresdemploi' ),
	'meta_query'             => array(
		'relation' => 'AND',
		array(
			'key'     => 'type_doffre',
			'value'   => 'non-demciale',
			'compare' => '=',
		),
		array(
			'key'     => 'priorite',
			'compare' => 'EXISTS',
		),
		array(
			'key'     => 'start_date_publication',
			'value'   => '2019-05-02',
			'compare' => '<=',
			'type'    => 'DATE',
		),
		array(
			'relation' => 'OR',
			array(
				'key'     => 'end_date_publication',
				'value'   => '2019-12-31',
				'compare' => '>=',
				'type'    => 'DATE',
			),
			array(
				'key'     => 'end_date_publication',
				'compare' => '!=',
			),
		),
	),
);

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