Searching events
-
Hi I love Events manager but I have a question
I noticed that events were not found by my search box so I added a function :
`
function rc_add_cpts_to_search($query) {
// Check to verify it’s search page
if( is_search() ) {
// Get post types
$post_types = get_post_types(array(‘public’ => true, ‘exclude_from_search’ => false), ‘objects’);
$searchable_types = array();
// Add available post types
if( $post_types ) {
foreach( $post_types as $type) {
$searchable_types[] = $type->name;
}
}
$query->set( ‘post_type’, $searchable_types );
}
return $query;
}
add_action( ‘pre_get_posts’, ‘rc_add_cpts_to_search’ );
?>Now events are found like other posts BUT the results page have no navigation bar
I reckon this is not a bug from events manager, but I guess there must be an simple way to solve this issue ?
The topic ‘Searching events’ is closed to new replies.