• Resolved trint

    (@trint)


    Hell oeverybody,
    I own both pro version and free version.
    I would like to show coming events and also not ended ones.
    At this time it shows future events and not events which began earlier and are not ended.

    Here is my Query:

    <?php
    $today = date("Y-m-d");
    $events_args = array(
     'showposts' => '5',
     'post_type' => 'tribe_events',
     'post_status' => 'publish',
     'orderby' => 'meta_value',
     'order' => 'ASC',
     'meta_query' => array(
      'relation' => 'AND',
      array(
      'key' => '_EventStartDate',
      'value' => $today,
      'compare' => '>=',
      ),
      array(
      'key' => '_EventEndDate',
      'value' => $today,
      'compare' => '>=',
      )
     )
    );
    ?>
    

    Any help appreciated.
    Best.
    Pierre

    • This topic was modified 4 years, 1 month ago by trint.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter trint

    (@trint)

    Hello everybody,
    any ideas or tips ?
    Best
    Pierre

    Thread Starter trint

    (@trint)

    Ok not needed to be complicated with ‘relation’ => ‘AND’.
    This one works like a charm.

    
    <?php
    $today = date("Y-m-d");
    $events_args = array(
     'showposts' => '5',
     'post_type' => 'tribe_events',
     'post_status' => 'publish',
     'orderby' => 'meta_value',
     'order' => 'ASC',
     'meta_query' => array(
      array(
      'key' => '_EventEndDate',
      'value' => $today,
      'compare' => '>=',
      )
     )
    );
    ?>
    
    • This reply was modified 4 years, 1 month ago by trint.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP Query next events and not ended events’ is closed to new replies.