- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
WordPress. How to change Google map location (API based)
November 24, 2014
This tutorial will show you how to change Google map location (API based) in WordPress templates.
WordPress. How to change Google map location (API based)
This map is usually embedded into Home page using shortcode [google_api_map]:
-
To change Google map location, you should edit custom-function.php file from wp-content\themes\themeXXXXX\includes folder, where XXXXX is your theme number. You can use FTP or File manager to locate and access the file.
-
Open the file and find the following lines:
if ( !function_exists('google_api_map_shortcode') ) { function google_api_map_shortcode( $atts, $content = null ) { extract(shortcode_atts(array( 'latValue' => '36.1372008' , 'lngValue' => '-115.1743134,9' , 'zoomValue' => '8' , 'custom_class' => '' ), $atts));
-
In order to change your Google map location, you should change latitude and longitude. Open https://www.google.com/maps/preview and find your location. Right-click a place or area on the map, select What’s here? and coordinates will appear in the search box at the top of the page:
-
Then edit custom-function.php file and change default coordinates with yours. Save changes to the file and re-upload it to the server overwriting the existing one.
-
You can also change zoom option value or add custom CSS class for your map.
Feel free to check the detailed video tutorial below:
WordPress. How to change Google map location (API based)
You can use this tip while creating your WordPress real estate website fast and simple. Don’t hesitate to check out!