Support

Home Forums Event Espresso Premium Check to see if Category has events

Check to see if Category has events

Posted: February 17, 2015 at 2:01 pm


Peyton Earey

February 17, 2015 at 2:01 pm

How would I check to see if a Category has events?

something like?

$test = get_posts('category_name=spice');
	if ($test) {
		echo 'we have spice events';
	}


Dean

February 18, 2015 at 4:43 am

Hi,

Sort of. You’re not looking for categories though, instead you need to look for custom taxonomies (terms).

The Event Categories is called espresso_event_categories

Take a look at get_posts taxonomy section and it should provide a clearer example than I can: http://codex.wordpress.org/Template_Tags/get_posts#Taxonomy_Parameters

The support post ‘Check to see if Category has events’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso