Home › Forums › Calendar Products › Community Events › Category View for Past Events returns Error
- This topic has 4 replies, 2 voices, and was last updated 9 years, 9 months ago by Barry.
-
AuthorPosts
-
June 25, 2014 at 8:16 am #250187ShaunParticipant
We have our list view of events setup to filter upcoming and past events. When you go to an upcoming event and select a category (such as here: http://dev.j2designpartnership.com/cgcs/web/events/category/summer-institute/)
When you go to a past event however, and click on category view (such as here: http://dev.j2designpartnership.com/cgcs/web/events/category/conferencesymposium/) a message stating “NO MATCHING EVENTS LISTED UNDER CONFERENCE/SYMPOSIUM. CHECK OUT UPCOMING EVENTS FOR THIS CATEGORY OR VIEW THE FULL CALENDAR.” appears. There are, however, 19 events in this category, however all are past.
Is this an issue with settings, that past events are not displayed in category view? Is there any kind of solution here?
We have events defaulted to list view, and a single event displays categories via a custom query to control the display output (i.e., not in list form)
$taxonomy = 'tribe_events_cat'; $terms = wp_get_post_terms($post->ID, $taxonomy); $i = 0; $count = count($terms); if ( $count > 0 ){ foreach ( $terms as $term ) { if($i == $count - 1) { echo 'slug, $taxonomy).'">'. $term->name . ""; } else { echo 'slug, $taxonomy).'">'. $term->name . ", "; $i++; } } }
I used the default **tribe_get_event_categories();**, which outputs, as far as I can tell, the same content as above, just in a list form.
June 25, 2014 at 8:35 am #250239BarryMemberIs this an issue with settings, that past events are not displayed in category view? Is there any kind of solution here?
By default category (and list view) generally shows only upcoming events. Ordinarily though there is a link to let you “page back” and view past events – it looks like that isn’t present and I wonder if that might be the result of some customizations you have made?
June 26, 2014 at 11:46 am #253301ShaunParticipantGotcha. I found out where the link was.
Is there anyway to show all events in a category, regardless of their event status?
I tried doing a custom query but it didn’t seem to work…that custom query is below. I’m not sure if this would work or not, but any advice?
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $upcoming = new WP_Query(); $args = array( 'post_type'=> 'tribe_events', 'paged' => $paged, 'eventDisplay' => array('past','upcoming'), ); $upcoming->query( $args );
June 27, 2014 at 1:33 pm #255877BarryMemberProbably setting eventDisplay to custom plus start_date and end_date parameters that are suitably far apart – 1000-01-01 and 3000-12-31 for example – would achieve that 🙂
July 25, 2014 at 6:52 am #505813BarryMemberHi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!
-
AuthorPosts
- The topic ‘Category View for Past Events returns Error’ is closed to new replies.