Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

query event with given category term

// WP_Query arguments
$args = array(
	'post_type'              => array( 'event' ),
	'post_status'            => array( 'publish' ),
	'tax_query'              => array(
		array(
			'taxonomy'         => 'event_category',
			'terms'            => 'activity',
			'field'            => 'slug',
		),
	),
);

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