How to query only the first instance of the Recurring Event

460 Views Asked by At

I want to query the event, but I don't know how to query only the first instance of the Recurring Event, Since my code query all the event, and it looks like a mess on the archive page, I just want to query the first instance.

$args = [
          'posts_per_page' => 999,
          'order'   => 'DESC',
          'tax_query' => [
                  [
                      'taxonomy' => 'tribe_events_cat',
                      'field' => 'slug',
                      'terms' => 'free-course',
                      'operator' => 'NOT IN'
                  ]
              ],
          ];

          $Eventlistings = tribe_get_events($args);
1

There are 1 best solutions below

2
Boris  Volkovich On
'posts_per_page' => 1

or you can take first instance like this

$Eventlistings->posts[0];