Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpflippercode/bc2eb104cc0250a2b66187e54f5327ad to your computer and use it in GitHub Desktop.
Save wpflippercode/bc2eb104cc0250a2b66187e54f5327ad to your computer and use it in GitHub Desktop.
Change Google Maps Zoom Level According to Page
add_filter('wpgmp_maps_options','wpgmp_maps_options',2,1);
function wpgmp_maps_options($options,$map) {
//Here You can change zoom level according to the page.
if(is_home()) {
$options['zoom'] = 10;
} else if ( is_page('map-locator') ) {
$options['zoom'] = 15;
}
return $options;
}
@opignon
Copy link

opignon commented Apr 28, 2020

error here : add_filter('wpgmp_maps_options','wpgmp_maps_options',2,1);

should be add_filter('wpgmp_maps_options','wpgmp_maps_options',1,2);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment