Posted: August 28, 2014 at 9:14 am
|
Hello, im trying to list some events in a special order. I’ve found something like this for a custom query:
But i don’t know what the standard query is and how i can modify it. Thanks for any tips! |
|
That code for a custom query is for EE3 if you were using the EE3 custom post type feature, which I’m guessing you are probably not. venue_id,event_meta=>"skill",date(start_date) is getting passed verbatim to the SQL query. Unfortunately, the SQL DB cannot sort on the event meta, because it is stored in the DB as a serialized field. The only thing you could do would be to resort the results in PHP after they have been fetched from the DB and before they are displayed. It would be a customization of the Custom Templates, so would require hiring a developer to do it. For small jobs like that, we can do up to a couple hours (yours would probably be an hour) on support tokens. The relevant code is in plugins/espresso-custom-templates/index.php, line 39. We would need to make a copy of that function and customize it. |
|
Hello, im using EE3. So one (ugly) option would be to sort by name and have a system like _1_4_2 this in the naming and cut the prefix away when showing it. Since categories in EE3 do not have a hierarchy, there is no way to filter in different blocks, right. Like sorting by a group of categories A and then by a group of B? Thanks! |
|
Hi, That’s pretty much correct. The Custom Templates use the Event List which uses an SQL, so as Sidney said, the custom meta can’t be sorted that way. |
The support post ‘orderby / sort by meta value’ 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.