Hi there,
I’ve just checked with our developer and a workaround for this would be to add the filter below to your functions.php file. However, this will limit all recurring events to display only a single event. I’d suggest that you give it a try and see if it’s what you’re looking for. Let us know how it goes.
function geodir_event_single_recurring( $groupby, $post_type ) {
if ( $post_type == 'gd_event' ) {
global $wpdb;
$groupby = " GROUP BY $wpdb->posts.ID ";
}
return $groupby;
}
add_filter('geodir_filter_widget_listings_groupby', 'geodir_event_single_recurring', 100, 2 );
you can also do the same for search results with this snippet:
/**
* Group the recurring events in search results.
*/
function gd_custom_group_recurring_events( $groupby, $wp_query ) {
global $wpdb;
if ( !empty( $_REQUEST['stype'] ) && $_REQUEST['stype'] == 'gd_event' && $wp_query->is_main_query() && geodir_is_page( 'search' ) ) {
$groupby = $wpdb->posts . ".ID";
}
return $groupby;
}
add_filter( 'posts_groupby', 'gd_custom_group_recurring_events', 100, 2 );