Support

Home Forums Event Espresso Premium Unable to hide expired events

Unable to hide expired events

Posted: August 28, 2019 at 8:54 pm

Viewing 6 reply threads


UCA Qld

August 28, 2019 at 8:54 pm

Hi,

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?

Regards,
Comms


Josh

  • Support Staff

August 29, 2019 at 12:02 pm

Hi,

May I ask can you share a link to the page in question so we can investigate further?


UCA Qld

August 29, 2019 at 4:47 pm

Hi Josh,

Here it is: https://www.trinity.qld.edu.au/events/

Regards,
Comms


Tony

  • Support Staff

August 30, 2019 at 5:31 am

The query used to pull the event in on that page isn’t the main query, it’s a custom query from the theme.

Can you send us a copy of the theme so we can see if there is a filter you can use to change that query?


UCA Qld

September 1, 2019 at 5:56 pm

This reply has been marked as private.


UCA Qld

September 1, 2019 at 5:58 pm

This reply has been marked as private.


Tony

  • Support Staff

September 2, 2019 at 8:06 am

Hi there,

Thank you for the theme.

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.

Event Espresso