Skip to content

Instantly share code, notes, and snippets.

@wpflippercode
Last active September 8, 2017 07:13
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/d0cab9c448c2f744612b21b217efa443 to your computer and use it in GitHub Desktop.
Save wpflippercode/d0cab9c448c2f744612b21b217efa443 to your computer and use it in GitHub Desktop.
Change map's zoom level according to page type.
add_filter('wpgmp_maps_options', 'wpgmp_maps_options',1,2 );
function wpgmp_maps_options($map_settings,$map) {
global $post;
if(is_front_page()) {
$map_settings['zoom'] = 15;
} else if(is_single()) {
$map_settings['zoom'] = 10;
} else {
$map_settings['zoom'] = 5;
}
return $map_settings;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment