Support

Home Forums Events Calendar Add-on Events List Widget – Orderby start_date AND START_TIME, events are out of order!

Events List Widget – Orderby start_date AND START_TIME, events are out of order!

Posted: July 24, 2013 at 3:38 pm


Mary Clare Bland

July 24, 2013 at 3:38 pm

I have the upcoming events list setup but it is not ordering the events in the proper order. It is only ordering them by the start date, but not the start time, which displays 7pm events before 10am events and causes confusion for site visitors.

What should I modify in the following code from widget.php to also add the time variable into consideration:
$order_by = " ORDER BY date(start_date), id ASC ";

Also, is there anyway to exclude items where the registration has been closed, or events that have passed on the current day. I only want to display upcoming events.


Josh

  • Support Staff

July 24, 2013 at 4:47 pm

Hi Mary,

You can modify the code to include the start time:

$order_by = " ORDER BY date(start_date), ese.start_time, id ASC ";

The widget settings has an option that can be set to “No” for “Show Expired Events”

The support post ‘Events List Widget – Orderby start_date AND START_TIME, events are out of order!’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso