Popular Categories

How to get featured events from Event Calendar?

If you wanted to highlight, promote, or feature a specific event on your site, The WordPress Events Calendar’s “Featured Events” are very useful. Making an event “Featured” imbues it with a number of special properties that make it stand out from non-featured events. Hence, when developing a custom WordPress theme one of the very requirements will be on how to handle these featured events and how to query them.

Well here is a snippet of code that can help you achieve this.

$featured_query = new WP_Query();
	'post_type' => 'tribe_events',
	'posts_per_page' => '1',
	'orderby' => 'rand',
	'eventDisplay' => 'upcoming',
	'tax_query' => array(
			'taxonomy' => 'tribe_events_cat',
			'field' => 'slug',
			'terms' => 'featured',
			'operator' => 'IN'

if ($featured_query->have_posts()) :
	while ( $featured_query->have_posts() ) : $featured_query->the_post();
		// show the event here with whatever function you need

The above code will return a random single featured event. You can use this code within the theme files or even in templates.