Support

Home Forums Event Espresso Premium Any way to hide expired events in the [ESPRESSO_MY_EVENTS] shortcode?

Any way to hide expired events in the [ESPRESSO_MY_EVENTS] shortcode?

Posted: October 4, 2016 at 6:02 pm


gongconduit

October 4, 2016 at 6:02 pm

I find this documentation on https://eventespresso.com/wiki/wp-user-integration/#ee4-my-events on [ESPRESSO_MY_EVENTS] and trying to see if we can hide expired events for our users. They really only need to see the upcoming events, having the expired events is confusing. Thanks! Jeff


Josh

  • Support Staff

October 6, 2016 at 2:15 pm

Hi Jeff,

It’s possible and it can be done by making a small edit to a PHP template file, then you copy that template file over to your WordPress theme. It’s best practice to set up a child theme so you don’t lose your changes on a theme update.

If you’re using the standard content-espresso_my_events-event_section.template.php template, you copy that to your theme, then add the following at the top of the file after the opening PHP tag:

if ( $event->get_active_status() == 'DTE' ) { return; }

The support post ‘Any way to hide expired events in the [ESPRESSO_MY_EVENTS] shortcode?’ 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