Support

Home Forums Event Espresso Premium How to not show expired dates on event pages

How to not show expired dates on event pages

Posted: June 1, 2020 at 6:01 pm

Viewing 1 reply thread


whiscreative

June 1, 2020 at 6:01 pm

In my event Template settings I have “Display Expired Events” setting to No.
When I have upcoming dates for my event, expired events don’t show, however when the dates are all past, they page then shows ALL the expired dates.
But in this case i want it to show no dates

Eg. https://bit.ly/3gFLc6e
Here you can see all events are past, so its showing ALL the old ones. As new dates are always being added I can’t remove the page from the site as its just waiting for new dates to be scheduled


Tony

  • Support Staff

June 2, 2020 at 8:08 am

Hi there,

To do this you’ll need to alter the template used by Event Espresso.

Go to \wp-content\plugins\event-espresso-core-reg\public\Espresso_Arabica_2014\

Copy the content-espresso_events-datetimes.php template to your machine.

Open that up and change

espresso_list_of_event_dates( $post->ID );

To be:

espresso_list_of_event_dates( $post->ID, '', '', true, false );

Now place that altered template in your themes root directory, if you are not currently using a child theme I recommend creating one:

https://developer.wordpress.org/themes/advanced-topics/child-themes/

With the above change, if no datetimes are available it will display:

There are no upcoming dates for this event.

That can also be changed if needed.

Viewing 1 reply thread

The support post ‘How to not show expired dates on event pages’ 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