In Event Espresso >> Events >> Templates, I’ve chosen “No” for “Display Expired Events”, but the default event list page still shows expired events. How could I fix that?
So on the initial page load with the main query EE is filtering what we define as ‘expired events’ filtered from it.
For example, if one of the expired events you are referring to is the ’29 August 2019 – Growing Thriving Teams Workshop’ event, that’s not an expired in EE as is has a single DateTime assigned to it with the start date set as 2019-08-29 and the end date as 2019-09-19.
So at the time of writing, that event is ‘active’ (the current date is between the events start and end dates) and isn’t filtered.
However, your custom query using ajax doesn’t filter expired events so it will return those when you use the category function you added. I see you have a custom cb_posts_where function but thats only filters events based on dates when the sel_date option is set. You can set that to filter expired events when sel_date is not set.
Take a look at how EventEspresso\core\domain\services\wp_queries\EventListQuery sets up the filters and it should help you get what you need.
Viewing 6 reply threads
The support post ‘Unable to hide expired events’ 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.