Help Desk

Category View for Past Events returns Error

  • Posts: 10 Topics: 11
    | Permalink

    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.

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    Is 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?

    Posts: 10 Topics: 11
    | Permalink

    Gotcha. 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 );
    
    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    Probably 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 🙂

     

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    Hi! 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!