Excellent! Many thanks for that. I've now removed the API restrictions on my key and put it back instead of yours. I will need to restrict it, though. What's the best method for this?
Finally, how can I prevent a view where all markers are shown? I only want to show markers within the set radius of the location entered and never show them all.
I've added the following code to "Custom Code" section offered by Toolset:
=> hidden link
add_filter( 'wpv_filter_query', 'func_no_results_first', 99, 3 );
function func_no_results_first( $query_args, $view_settings, $views_id ) {
if ( $views_id == 2348 && !isset($_GET['wpv_view_count']) ) { // if it is specific view and by default
$query_args['post__in'] = array(0);
}
return $query_args;
}
You can customize the "No Items found" message within your view's Loop Editor section with some fancy text 🙂