Support

Home Forums Event Espresso Premium Expired events in website global search

Expired events in website global search

Posted: November 27, 2019 at 8:16 am

Viewing 1 reply thread


TheEA

November 27, 2019 at 8:16 am

I am trying to exclude expired events from my website search. I found this post and deployed the code suggested by Josh.

https://eventespresso.com/topic/expired-events-still-show-up-in-global-search-results-2/#post-249886

However, that code is blocking other posts and pages on my site and showing ONLY Event Espresso event. You can see the result here:
https://theeastaging.wpengine.com/?s=HR

How can I hide expired events yet include other posts and pages on the site?


Josh

  • Support Staff

November 27, 2019 at 10:50 am

Hi,

I think you’ll need a separate search field for events to accomplish this. The reason being is the filters that can be added to the query get added before the query. In other words, we can tell the query to filter away expired events but there isn’t a way to tell the query to only apply those filters to only some of the results.

One way to add a separate search field is install this plugin:
https://wordpress.org/plugins/custom-post-type-widgets/
Then add its search widget for custom post types to a widget area on your website.

Viewing 1 reply thread

The support post ‘Expired events in website global search’ 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