Hello Javier,
Use following snippet and change widget id & post type accordingly.
/*
* Set search default post type.
*/
function gd_snippet_widget_geodir_advance_search_args( $args, $instance ) {
if ( ( geodir_is_page( 'home' ) || geodir_is_page( 'location' ) ) && ! empty( $args['widget_id'] ) ) {
if ( $args['widget_id'] == 'geodir_advance_search-1' ) { // Change 1st widget id here.
$args['post_type'] = 'gd_event'; // Change to 1st post type.
}
if ( $args['widget_id'] == 'geodir_advance_search-2' ) { // Change 2nd widget id here.
$args['post_type'] = 'gd_place'; // Change to 2nd post type.
}
}
return $args;
}
add_filter( 'widget_geodir_advance_search_args', 'gd_snippet_widget_geodir_advance_search_args', 10, 2 );
Thanks,
Kiran