Support » Plugin: The Events Calendar » Expired events not being removed from eventDisplay

  • Resolved controlz


    I can’t figure out why the events I have listed in a side menu continue to show past/expired events. I was hoping that when an event passed the PHP would get the next event and not continue to display events that have already ended.

    Here is the PHP I am using to call events:
    global $post;
    $all_events = tribe_get_events(array(

    foreach($all_events as $post) {

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Rob La Gatta


    Hey controlz. What you’re describing as your hope *should* be how it functions; I’m wondering if the query has an issue with it. (Im assuming you wrote that yourself, but let me know if not).

    Any chance you’ve got a link to the site, so we can check this out? I’ll get a dev to take a look as needed from there. Thanks in advance!

    I found the answer after some digging. I was using the wrong call. Here’s what I ended up using which seems to be working as it should by only showing upcoming events.

    <section class=”events”>
    <h3>Upcoming Events</h3>

      global $post;
      $current_date = date(‘j M Y’);
      $end_date = date(‘j M Y’, strtotime(’30 days’));

      $get_posts = tribe_get_events(array(‘start_date’=>$current_date,’end_date’=>$end_date,’posts_per_page’=>3) );

      foreach($get_posts as $post) {

    • “><?php the_title(); ?>
    • <?php } //endforeach ?>
      <?php wp_reset_query(); ?>


    Plugin Author Rob La Gatta


    Ah, thanks for confirming as much – glad to hear you got this sorted. Thanks, too, for sharing the results of your efforts…other users in the same boat who visit the forums later will definitely appreciate it.

    Sounds like you’re all set here, but please let us know if you need anything else in the future. Thanks for using The Events Calendar.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Expired events not being removed from eventDisplay’ is closed to new replies.