When using Location Manager, you can add a Near Me search feature to your search bar, that shows locations that are in proximity to user’s location.Â
You can replace the default “In:” text shown in search results with “Near:” using the following code snippet:Â
We recommend using the Code Snippets plugin to add snippets to your site.
function gd_snippet_search_disable_in_location( $script ) {
$script = str_replace( 'gdlm_ls_city_suggestion();', ' gdlmls_doing_search = 0;gdlm_ls_maybe_suggest_more();', $script );
$script = str_replace( 'function gdlm_ls_current_location_suggestion() {', 'function gdlm_ls_current_location_suggestion() {return;', $script );
$script = str_replace( array( 'gdlm_ls_region_suggestion();', 'gdlm_ls_country_suggestion();', 'gdlm_ls_neighbourhood_suggestion();' ), '', $script );
return $script;
}
add_filter( 'geodir_location_switcher_footer_script', 'gd_snippet_search_disable_in_location', 10, 1 );