Support

Home Forums Event Espresso Premium Table template order by (start date) not working

Table template order by (start date) not working

Posted: November 8, 2022 at 4:28 am


LSCS

November 8, 2022 at 4:28 am

I have been using the shortcode
[ESPRESSO_EVENTS_TABLE_TEMPLATE order_by=start_date category_slug=virtual-workshop category_filter=false table_search=false show_expired=false]
to display all upcoming events in ascending order of starting date.
It is not working, and I have tried various alternatives with no luck – it seems to default to using the post id to sort on.

I happened to add a 2nd table on the same page, and it DID order correctly. Ditto with a 3rd or 4th table.
At first I though this bizarre, but now I suspect there is some kind of script loading that happens with the first table that allows the sorting to work on all the other tables.
Any help much appreciated.
Thanks
Kris


Tony

  • Support Staff

November 9, 2022 at 4:38 am

Hi Kris,

Can you link me to the page in question so I can take a look at what is happening?


LSCS

November 9, 2022 at 5:02 am

Hi Tony, I’ve set up a test page to show you
https://childcarestudies.co.uk/virtual-workshops-test-page-for-debugging/

The short code for each table is the same:
[ESPRESSO_EVENTS_TABLE_TEMPLATE order_by=start_date category_slug=virtual-workshop category_filter=false table_search=false show_expired=false]

Thanks,
Kris


Tony

  • Support Staff

November 9, 2022 at 5:29 am

Erm…. hmmm, odd!

So, the initial sorting shouldn’t be done via Javascript, that first table should be loading by date order just like the others.

Are any caching plugins enabled?

I’ll check into this on a test site now.


LSCS

November 17, 2022 at 6:55 am

Hi Tony, did you manage to get anywhere with this?
Re caching plugins, I use W3 total cache..


Tony

  • Support Staff

November 18, 2022 at 6:14 am

Hi Kris,

Apologies for the delay, I spent some time looking into this but I can’t reproduce it.

Single and multiple instances of the table view template are sorted as expected for me. The order_by=start_date part of the shortcode is passed directly to the query and sets the order returned by the query itself, the JS can then manipulate from there but even if I load the page with JS disabled I get the same results.

Strange!

In terms of the order of the event, does anything change it you remove the category parameter? So remove this from the first shortcode – category_slug=virtual-workshop

You must be logged in to reply to this support post. Sign In or Register for an Account

Event Espresso