Support

Home Forums Community Forum How do I get Events for a given category?

How do I get Events for a given category?

Posted: June 28, 2016 at 9:00 pm


Eli Madden

June 28, 2016 at 9:00 pm

This doesn’t work:

$args = array(
		'espresso_event_category' => $cat_slug,
		'post_type' => 'espresso_events'
	);
	$posts = get_posts( $args );

I’ve tried a bunch of variations but no luck. How do I get the events so I can make my own list of events for a given category?

Thanks


Eli Madden

June 28, 2016 at 9:46 pm

(not allowed to edit previous post for indenting)


Eli Madden

June 29, 2016 at 11:40 am

This works
`$args = array(
‘espresso_event_categories’ => $cat_slug,
‘post_type’ => ‘espresso_events’
);
$posts = get_posts( $args );


Eli Madden

June 29, 2016 at 11:44 am

(I edited the indenting that time but it changed when posted)

The support post ‘How do I get Events for a given category?’ 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