Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Get all events top level

// WP_Query arguments
$args = array(
	'post_type'              => array( 'event' ),
	'post_status'            => array( 'published' ),
	'meta_query'             => array(
		'relation' => 'OR',
		array(
			array(
				'key'     => 'repeating',
				'value'   => 'false',
				'compare' => '=',
				'type'    => 'BINARY',
			),
		),
		array(
			'relation' => 'AND',
			array(
				'key'     => 'repeat_option',
				'value'   => 'Custom',
				'compare' => '!=',
				'type'    => 'CHAR',
			),
			array(
				'key'     => 'repeating_until',
				'value'   => 'now',
				'compare' => '>=',
				'type'    => 'DATE',
			),
		),
		array(
			'relation' => 'AND',
			array(
				'key'     => 'repeat_option',
				'value'   => 'Custom',
				'compare' => '=',
				'type'    => 'CHAR',
			),
			array(
				'key'     => 'custom_options_$_start_date',
				'value'   => '$today',
				'compare' => '>=',
				'type'    => 'DATE',
			),
		),
	),
);

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