Tagged: category, events, maker, specific
thanks for the great plugiN! :)
I adding this plugin to my theme and because of that i’m doing some customization.
I want to list events from only one category, or from specific ones. Or from some and not others.
Im trying this way (show only events from category one) , but it still list all events.
$args = array(
‘post_type’ => ‘event’, // required
‘suppress_filters’ => FALSE, // required
‘posts_per_page’ => -1 // optional
‘cat’ => 1,
$events = new WP_Query($args);
<?php while ( $events->have_posts() ) : $events->the_post();
This will not work because you’re using ‘cat’. Event category is not the same as blog category – it’s a custom taxonomy named ‘event-category’.
Of course you can run any type of query here but you need to use ‘tax_query’ parameter as it’s described in WP_Query class in WP codex.
Ok, so maybe I’m a little dense. I’m running WP 4.2.2 and Event Maker 1.6.1. I’m trying to use em_get_events().
$args = array(
‘number_of_events’ => 5,
‘tax_query’ => array(
‘taxonomy’ => ‘event-category’,
‘field’ => ‘name’,
‘terms’ => ‘frontPageEvent’,
‘include_children’ => false,
‘operator’ => ‘IN’
‘post_status’ => ‘publish’);
$fpEvents = em_get_events($args);
In my test case I have one event placed into two event_category items. I’m trying to get only future events (no past events). However, for some reason I’m not getting any events from the query.
Any help / pointers are much appreciated.
What does em_get_events() function without any parameters return?
After you register and login to the site, you may post all plugin support questions in the Support Forum.
If you need to provide private info, please create a ticket and then reply to it using Set as private reply option.