Event not showing if started in the past & ends today or in the future
-
I am looking to use The Events Calendar for a customer's website. I am a custom plugin developer. I am using the tribe_get_events() function with example from: https://theeventscalendar.com/knowledgebase/k/using-tribe_get_events/ I am trying to toggle between current/future events and past events. However, the code I used below does not display events that started in the past and ends today or in the future. It successfully shows events that start & end in past or in the current/future. I am using the following code: $filter=$_REQUEST['filter']; // a parameter sent to the script switch ( $filter ) { case "past": $key = 'end_date'; $value = 'now'; $order = 'DESC'; break; default: $key = 'start_date'; $value = 'now'; $order = 'ASC'; } $aa_events_listing = tribe_get_events( [ 'posts_per_page' => 9999, // I want all the events that match "$key" => "$value", 'order' => "$order", ] ); I also tried changing $value = 'today'; but no success. Any help is greatly appreciated! Randy
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Event not showing if started in the past & ends today or in the future’ is closed to new replies.