Support

Home Forums Event Espresso Premium Show only Expired Events / Not upcoming ones

Show only Expired Events / Not upcoming ones

Posted: September 17, 2019 at 2:38 pm

Viewing 2 reply threads


SpecialistsofSchools

September 17, 2019 at 2:38 pm

On the events archive template page (archive-espresso_events.php) I’m using the following

do_shortcode(‘[ESPRESSO_EVENTS show_expired=true order_by=start_date sort=DESC]’);

to show all events in a list including past ones. I want to filter out any upcoming ones as the client feels this is confusing. I followed the instructions in this thread but the upcoming events are still in the list.

https://www.specialistsofschools.org/programs/


SpecialistsofSchools

September 17, 2019 at 2:39 pm

Sorry, followed the instructions in this thread:
https://eventespresso.com/topic/show-only-expired-events-2/


Josh

  • Support Staff

September 18, 2019 at 6:50 am

Hi,

I would not advise to use a do_shortcode() in the main query of a custom post type archive template like that. That will break many of your site’s views.

What you could do instead is a one-off custom page template, and use the provided code from the other topic, from this gist:

https://gist.github.com/joshfeck/d68b3c6da61c92ce92c4f77a958a20de

Please note there’s a conditional that you’ll need to adjust, this one:

if ( is_page( 'past-events-page' ) ) {

So you’ll change past-events-page to match your past events page’s page slug.

Viewing 2 reply threads

The support post ‘Show only Expired Events / Not upcoming ones’ 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