Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #26745

    On the homepage here:

    I have a column listing for upcoming events of category ‘featured’

    and a column for events that are happening today.

    The problem is I am seeing events under today that are happening 2 days in the future

    Here is the code I am using to query those events in helper-template-dynamic.php

    function columns_helper_today_entries($data)


    $data = ‘avia_add_event_range’;

    $data = true;

    $data = TribeEvents::POSTTYPE;

    $current_date = date(‘j M Y’,strtotime(‘1 day’));

    $data = array(‘start_date’=>$current_date,’end_date’=>$current_date);

    return $this->columns_helper_latest_entries($data);



    Did you try

    $current_date = date('j M Y');
    $end_date = date('j M Y', strtotime('now'));


    $current_date = date('j M Y');
    $end_date = date('j M Y', strtotime('+1 day'));

    – do you notice any changes? Some other examples can be found here: (Purchase code hidden if logged out) -general-functions/#functiontribe_get_events


    well, i tried all the permutations i could think of with now, +1, or nothing and I either receive results for 2 days from now, or no results.

    not sure what’s up or what to try…

    i would post on the tribe forum if i could but it’s for licensed members only


    Maybe the query itself doesn’t work. Did you try to insert the sample code:

    global $post;
    $current_date = date('j M Y');
    $end_date = date('j M Y', strtotime('1 day'));

    $get_posts = tribe_get_events(array('start_date'=>$current_date,'end_date'=>$end_date,'posts_per_page'=>10) );

    somewhere? Do you get the same results if you call the tribe_get_events() function directly without using $data?

    Btw the devs sometimes help users for free in the official forum:


    Thanks for the suggestions

    After doing a more testing and research I figured it out.

    For some reason it only provides the correct results when i query events between yesterday and today. That seems odd…

    Also I needed to set eventDisplay to all for some reason

    Here is the code that seems to work currently:

    $today = date(‘j M Y’);

    $yesterday = date(‘j M Y’,strtotime(‘-1 day’));

    $data = array(‘start_date’=>$yesterday,’end_date’=>$today,’eventDisplay’=>’all’);

    return $this->columns_helper_latest_entries($data);



    Glad you found a solution :)

    Best regards,


Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Query today's events only’ is closed to new replies.