Support

Home Forums Event Espresso Premium Remove Expired Events from Shortcode

Remove Expired Events from Shortcode

Posted: June 13, 2016 at 11:02 am

Viewing 3 reply threads


Jarred

June 13, 2016 at 11:02 am

Hello, We are using category shortcodes on a few different pages.

When an event expires, we get one of two messages, either sold out or We’re sorry, but all ticket sales have ended.

We are okay with both messages BUT, here is what we want to change.

Once the art camps start, like today for example.

https://artsyrose.com/camps/

We want those to just disappear completely from the art camps page on the day that they start because it makes new visitors have to scroll down further to see the events they can actually register for.

Here is the shortcode we are using on the art camps page.

[ESPRESSO_EVENTS category_slug=”summer-art-camps”]

How can we make events that start today completely fall off the page instead of having them be on there showing ticket sales have ended.

Thanks


Lorenzo Orlando Caum

  • Support Staff

June 13, 2016 at 11:23 am

Hello Lisa,

That can be done by adding the sample code in the link below to a site specific plugin (https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/):

https://github.com/eventespresso/ee-code-snippet-library/blob/master/templates/de_ee_filter_events_out_with_expired_tickets.php

That will exclude events with expired ticket options from appearing on the event listings page.


Lorenzo


Jarred

June 13, 2016 at 11:40 am

Awesome, it worked perfectly. We added it to our child theme functions instead of creating new plugin because our child theme functions page doesn’t reset on updates. Thanks for the quick reply.


Lorenzo Orlando Caum

  • Support Staff

June 13, 2016 at 12:47 pm

Hello, thanks for letting us know that this worked out.

We suggest either a site specific plugin or a child theme’s functions.php as one of those should allow you to safely add the customization without it being lost upon an update.

I’ll update your support post to resolved.


Lorenzo

Viewing 3 reply threads

The support post ‘Remove Expired Events from 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