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?
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:
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.
Support forum for Event Espresso 3 and Event Espresso 4.