Posted: August 13, 2014 at 11:00 am
|
Is it possible to list events sorted by date, then by start time? Our event pages are listing by date but not in order by start time. |
Hi, What version of Event Espresso are you using? — |
|
|
EE3. |
Hi, is it possible that these events were not created in chronological order? There is a shortcode that can help you sort events but the order that they were created may play a factor here: https://eventespresso.com/wiki/shortcodes-template-variables/#event-list Give this a try on a WordPress page: [EVENT_LIST order_by=date(start_date),id] You can “preview” before publishing to test it out. — |
|
|
The events were not created in chronological order, no. The shortcode you posted gave me what I already have, using this shortcode: [EVENT_LIST category_identifier=convention-events-1396839515] I have a list of events in date order, but not in order of start time. I need the list to be in order by date, then by the event’s start time, for example: EVENT 1 EVENT 2 EVENT 3 and so on. |
Try this: [EVENT_LIST category_identifier=convention-events-1396839515 order_by=date(start_date),id] — |
|
|
I did try that – it still doesn’t list the events by start time, only by date. Let me rephrase my request so we’re clear: Currently, my event listing pages are ordering events by date, but not by time, like so: EVENT 1 EVENT 2 EVENT 3 EVENT 4 So in some cases, events that start later in the day are showing up on the list before earlier events, as in the example above (the 10:00 am event on October 4 is showing before the 9:00 am event on the same date). I believe they are ordering first by date, then by ID. I need the events to be ordered first by date, then by start time, regardless of the ID, like so: EVENT 1 EVENT 3 EVENT 2 EVENT 4 Is this possible, and if so, how do I do it? |
You’ll need the Order by to be DATE(start_date),TIME(start_time) so something like this: [EVENT_LIST category_identifier=convention-events-1396839515 order_by=DATE(start_date),TIME(start_time) sort=ASC] Should work. |
|
|
Thanks, that seems to have done the trick. I don’t recall seeing time(start_time) listed as an option for orderby parameters on the shortcode page Lorenzo linked to in his second post above. It would have saved a lot of time if that parameter had been listed there. |
|
Hi, Thanks for the feedback, I’ve updated the documentation to include that. |
The support post ‘List events sorted by date and time’ 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.