Last active
September 8, 2017 07:13
-
-
Save wpflippercode/d0cab9c448c2f744612b21b217efa443 to your computer and use it in GitHub Desktop.
Change map's zoom level according to page type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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