Events Made Easy › Forums › How do I … › EME_Events Order Statement
- This topic has 3 replies, 2 voices, and was last updated 8 years ago by
Franky.
-
AuthorPosts
-
Sun 20 May 2018 at 11:11 #58033
Anonymous
InactiveHello,
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.
Mon 21 May 2018 at 17:02 #58034Franky
Keymaster‘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’Wed 13 Jun 2018 at 22:27 #58150Anonymous
InactiveThanks 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.
Fri 15 Jun 2018 at 10:50 #58151Franky
KeymasterSeems 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 … -
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.