Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

agenda

// WP_Query arguments
$args = array(
	'post_type'              => array( 'agenda_cpt' ),
	'post_status'            => array( 'publié' ),
	'order'                  => 'DESC',
	'orderby'                => 'date',
	'tax_query'              => array(
		array(
			'taxonomy'         => 'categorie_tag',
			'field'            => 'name',
		),
	),
	'meta_query'             => array(
		'relation' => 'AND',
		array(
			'key'     => 'offre_active',
			'value'   => '1',
			'compare' => '=',
		),
		array(
			'key'     => 'offre_active',
			'value'   => '1',
			'compare' => '!=',
		),
	),
);

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

// The Loop
if ( $query-agenda->have_posts() ) {
	while ( $query-agenda->have_posts() ) {
		$query-agenda->the_post();
		// do something
	}
} else {
	// no posts found
}

// Restore original Post Data
wp_reset_postdata();