I’m using EE4 and I’d like to sort my query by name.
I have a custom query using your recommended code to attach to the $wp_query call: $wp_query = new EE_Event_List_Query( $atts ); and everything is working fine except that I can’t sort by name.
The 'order_by' -> in $atts defaults to ORDER BY event_start_date in the query.
Unfortunately, I see that the only sorting options are ticket and venue related.
Is there a way to add another ‘case’ to this function to sort by event name without modifying a core file? Or maybe there’s another approach to sort this query by name that I haven’t considered.
EE_Event_List_Query was actually deprecated. A few options you can consider would be to use the EventListQuery class with your own attributes, or you can use the WP_Query without the extended class.
If you can post some example code in a gist or pastebin I can give you more specific examples on what to change there.
The support post ‘Sort EEH_Event_Query by event name’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.