Posted: August 26, 2014 at 10:10 am
|
Hi Have events entered over 5 days and am using the Event Category as a menu listing. While it sorts the events ok by date, it shows the results in a random time order. How can I get it to order by Time and Date. Thanks. WordPress Version: |
Hi, Are you using this shortcode? [ESPRESSO_EVENTS category_slug=”free-events” order_by=”start_date,id”] — |
|
|
That short code works in that the events are in the right order, but it creates a page with an enormous event picture and no event information, while using the Appearance>Menus>Event Categories creates a perfect layout of picture and event information, just in the wrong order. |
Is the event categories page showing the events in reverse chronological order? — |
|
|
No, somewhat random. Here is one page http://www.sherborneliterarysociety.com/event-category/member-festival-wednesday/ |
|
Hi James, The only way to achieve what you are after is to modify the template files. Copy these files to your theme folder /wp-content/plugins/event-espresso-core-reg/templates/Espresso_Arabica_2014/archive-espresso_events.php Copy the function from this file to your themes functions.php In the loop-espresso_events.php above the if have posts section add if( is_tax() ) { $cat = single_cat_title( '', false ); if($cat != '') { $cat = strtolower( str_replace(' ', '-', $cat ) ); } else { $cat = NULL; } $atts = array( 'title' => NULL, 'limit' => 100, 'css_class' => NULL, 'show_expired' => FALSE, 'month' => NULL, 'category_slug' => $cat, 'order_by' => 'start_time', 'sort' => 'ASC' ); // run the query global $wp_query; $wp_query = new EE_Event_List_Query( $atts ); } At the bottom of the page add // now reset the query and postdata wp_reset_query(); wp_reset_postdata(); That should make it so that the /event-category/my-category-name/ events will be ordered by time. You may still need to style them though, just like you would have to with the shortcode. |
The support post ‘EE4 Sort category listing results by 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.