Support

Home Forums Event Espresso Premium Order_by Start_date Isn't Working in archive-espresso_events.php – EE4 4.4.3p

Order_by Start_date Isn't Working in archive-espresso_events.php – EE4 4.4.3p

Posted: October 28, 2014 at 9:32 am


James Kramer

October 28, 2014 at 9:32 am

My list of events is not being ordered chronologically. Here’s what I have:

EE_Registry::instance()->load_helper(‘Event_View’);

$atts = array(
  'limit' => -1,
  'show_expired' => FALSE,
  'order_by' => 'start_date',
  'sort' => 'ASC',
);

global $wp_query;
$wp_query = new EE_Event_List_Query( $atts );

Please see this page for the unordered list of events that should be displayed in chronological order.


Josh

  • Support Staff

October 28, 2014 at 10:24 am

Hey James,

It looks like the one event that’s out of order is the sold out one for Oct. 29. Does that event happen to have an earlier datetime that is expired?


James Kramer

October 28, 2014 at 10:49 am

Actually, there are two events out of order. Oct 29th and the one after it, Nov 9th.

Which datetime? The event start and end date are both Oct 29th (6pm to 8pm). There is one ticket with a Sale Start date of Oct 15th and the Sell Until date is Oct 29th at 6pm. The event was “published” on Sep 30th. Though, it’s not published it was saved as Sold Out (which we want to have displayed on the site to show activity).


Josh

  • Support Staff

October 28, 2014 at 11:08 am

Hi James,

I checked the feed here:

http://artandwineohmy.com/events/feed/

and the events are ordered correctly there. Are the events ordered correctly when you disable your custom templates?


Mike Wilson

October 28, 2014 at 12:17 pm

Hi,

I had the same issue. I’m also trying to get resolution on this same issue specifically for category archives – here.

I was told there was a change made to latest version of EE4 where events in the events list archive are now ordered by start date by default. I was using the same basic code as shown above and it was effectively breaking our events order. I removed the custom query and now events (only in the archive page) are ordered correctly by start date.


James Kramer

October 28, 2014 at 12:35 pm

Mike, thank you so much for posting. That was the problem. I removed literally all code mentioned above and now it works perfectly.


Mike Wilson

October 28, 2014 at 1:02 pm

You’re welcome, glad I could help! 🙂

The support post ‘Order_by Start_date Isn't Working in archive-espresso_events.php – EE4 4.4.3p’ 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.

Event Espresso