Support

Home Forums Event Espresso Premium Event list – how to have 2 Upcoming and Past events blocks?

Event list – how to have 2 Upcoming and Past events blocks?

Posted: December 14, 2016 at 2:48 am

Viewing 2 reply threads


liatoss

December 14, 2016 at 2:48 am

Hello there,
I use EE and on front page of my site, I would like to have a list of events, where one can clearly see Upcoming events as well as Past events.
When I use shortcode as follows: [ESPRESSO_EVENTS order_by=”start_date,id” sort=”DESC” show_expired=true] the page starts with Title “Upcoming Events” event if there is no such events. I checked the code, there are no any check on the fact that a list of upcoming events might be empty.

Please let me know what is the best technique to achieve the goal I stated in the title? Shell I rewrite loop-espresso_events.php in my child theme in a way to achieve the goal or there are some hidden settings which can allow me to achieve the goal?

Thx, Vlad.


Josh

  • Support Staff

December 14, 2016 at 8:59 am

Hi there,

I would advise against using shortcodes and advise against re-writing loop-espresso_events.php. Instead it’d be best to build a custom template with two loops, one for upcoming events, and another for past events. You’ll find some example code that you can use to accomplish the above in this gist:

https://gist.github.com/joshfeck/56bc9e4a3683779fe90f


liatoss

December 18, 2016 at 3:20 pm

That was exactly what I started to do and the loop-espresso_events.php was the idea to redefine this file in a special template.

Anyway, thank you very much for the code, this is exactly what I needed…

Viewing 2 reply threads

The support post ‘Event list – how to have 2 Upcoming and Past events blocks?’ 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