Created
July 3, 2017 12:15
-
-
Save wpflippercode/bc2eb104cc0250a2b66187e54f5327ad to your computer and use it in GitHub Desktop.
Change Google Maps Zoom Level According to Page
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',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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
error here : add_filter('wpgmp_maps_options','wpgmp_maps_options',2,1);
should be add_filter('wpgmp_maps_options','wpgmp_maps_options',1,2);