Support

Home Forums Event Espresso Premium Events not showing up in WordPress Search

Events not showing up in WordPress Search

Posted: February 7, 2019 at 6:42 pm

Viewing 2 reply threads


scaldwell

February 7, 2019 at 6:42 pm

I tried following the post’s code located on here: https://eventespresso.com/topic/add-events-to-search-results/

But it didn’t change anything. Will I need to use a different search plugin?

Thank you!
Shelly


Josh

  • Support Staff

February 8, 2019 at 9:12 am

Hi Shelly,
The code in that post did not include adding Event Espresso post types to the search.

If you’re not using a plugin for WP search (just using the native WordPress search), you can follow this:

https://thomasgriffin.io/how-to-include-custom-post-types-in-wordpress-search-results/

and where it has this:
$query->set( 'post_type', array( 'post', 'movies', 'products', 'portfolio' ) );

you’ll change to:
$query->set( 'post_type', array( 'post', 'espresso_events' ) );


scaldwell

February 8, 2019 at 12:04 pm

Ahhhhhh… THANK YOU!!!

Viewing 2 reply threads

The support post ‘Events not showing up in WordPress 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