- This topic has 3 replies, 2 voices, and was last updated 6 years, 5 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘How do I …’ is closed to new topics and replies.
Events Made Easy › Forums › How do I … › EME_Events Order Statement
Hello,
In the documentation it says you can use ASC, DESC or create your own order statement.
I want to show events ordered by oldest first, followed by ordering by category ID. If I use:
[ eme_events paging=1 limit=0 order=DESC showperiod=daily scope=this_week category=24,23,22]
…then it sorts by oldest event first but the categories are not ordered correctly.
If I try:
[ eme_events paging=1 limit=0 order=’event_category_ids DESC, event_start_date DESC, event_start_time DESC’ showperiod=daily scope=this_week category=24,23,22]
…then the categories are correct but the events are displayed newest first rather than oldest.
Is it possible to sort by event date AND category ID, and if so, what statement should I use?
Thank you for any help you can provide.
‘ASC’ corresponds with ‘event_start_date ASC, event_start_time ASC, event_name ASC’,
‘DESC’ corresponds with ‘event_start_date DESC, event_start_time DESC, event_name DESC’
So: DESC shows newest first, ASC oldest
I guess your order statement should simply be:
order=’event_category_ids DESC, event_start_date ASC, event_start_time ASC’
Thanks Franky. Sorry for the delay in responding.
I have tried both:
[eme_events paging=1 limit=0 order='event_category_ids DESC, event_start_date DESC, event_start_time DESC' showperiod=daily scope=this_week category=24,23,22,21,20,19,18,17,16,15,14,13]
AND:
[eme_events paging=1 limit=0 order='event_category_ids DESC, event_start_date ASC, event_start_time ASC' showperiod=daily scope=this_week category=24,23,22,21,20,19,18,17,16,15,14,13]
…and they both give exactly the same result. The events are ordered by event ID but the events happening sooner appear at the bottom of the page with the events furthest away appearing at the top.
Thanks for any help you can provide.
Seems to work just fine here. Don’t forget that first things get sorted by category id (as you requested), and then only by event date/time.
Leave out the category sorting if not required …