Does Event Espresso have a name for its custom post? Currently I am using the snippet below to add my custom posts to the results and would like to be able to include my Events.
/**
* This function adds custom posts to search results
*/
add_filter( ‘pre_get_posts’, ‘tgm_io_cpt_search’ );
/**
* This function modifies the main WordPress query to include an array of
* post types instead of the default ‘post’ post type.
*
* @param object $query The original query.
* @return object $query The amended query.
*/
function tgm_io_cpt_search( $query ) {
That function should do it, and you can add espresso_events to the array. You might want to add post back into the array to make sure regular WP posts are included in the search too.
Viewing 1 reply thread
The support post ‘Add Events to Search Results’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.