upcoming events query doesn't take into account the end time

Home Forums Calendar Products Events Calendar PRO upcoming events query doesn't take into account the end time

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26666
    Max
    Participant

    Hello, I have this query which displays the upcoming events.
    The only issue we have is that lets say in a day we have 2 events.
    One finishes at 11am and the next starts at 15pm.

    If I run this query at 11:30, I still see the first event that ended at 11am.

    Is there a way to add time control so that if the event date and time has passed, then the upcoming event query shows the next event?

    query_posts(array (
    ‘post_type’ => ‘tribe_events’,
    ‘eventDisplay’ => ‘upcoming’,
    ‘tax_query’=> array(
    array(
    ‘taxonomy’ => ‘tribe_events_cat’,
    ‘field’ => ‘slug’,
    ‘terms’ => $category
    )
    ),
    ‘posts_per_page’ => $limit,
    ‘order’ => ‘ASC’
    ));

    Thanks a lot

    #26675
    Barry
    Member

    Hi Max! Just for future reference, if you could post code using a service like Gist or Pastebin and link back here it is often easier to read – currently the forum doesn’t work nicely when code is posted directly.

    I think the basic problem you are going to have here is that WordPress itself isn’t designed to handle events, that of course is why we have The Events Calendar!

    But if you want to query events and still take advantage of all The Events Calendar’s goodness (retrieving only upcoming events for instance is a solved problem) then you should consider querying via the tribe_get_events() function rather than trying to work directly with WP_Query.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘upcoming events query doesn't take into account the end time’ is closed to new replies.