How to add multiple Google Maps in WordPress ?

At present, almost every site has integrated a Google Maps on a website seems popular enough to see, which is a great tool to let your visitors know where they can find you, but how can you add a Google map on your WordPress site? As you always have several WordPress extensions available, unfortunately we do not know that there could be performance problems or could hinder the future development of your site, so today I will teach you some simple methods, you can integrate google maps into your WordPress site.

1.Embed google map in WordPress using iframe.
Google Maps makes it easier to embed a map using iframes. It’s pretty easy – just go to the Google Maps website and enter the address of the place you want to display. Once you find the place, click on the share button in the left hand panel. This will display the embed code. Copy the iframe code, access the WordPress website, and paste the code into a post, page, template or a text widget. That’s all, Google Maps on your site is functional.

Embedded google map iframe

2.Add Google Maps to WordPress with your own custom shortcode.
Here’s a simple code snippet created using simple “short codes”, “meta box” and the “Google Maps Javascript API”, for that. You’ll need a “Google Maps API Key”, Please obtain the free API key, according to the procedure of the document. The following code snippet connects Google Maps to your posts, pages, templates, or text widgets also provides a better administrator posts and page interfaces too, here you can search the place and it will create a “short codes” you can use the same on your post,page or text widget. In addition, it offers many other options, including several Google Maps on one page. You can edit the width, height, and zoom of Google Maps. Follow the code snippet below. To perform these tasks, enter this code in the current theme function.php or add it to a new plugin, or click on the github button below to get the complete source code.
simple google map with marker
Note : Please make a note below all code snippet are self explanatory, if you have any quires please comment us.
1.Define your Google Maps API Key.

2.Enqueue required Javascript libraries to implement Google Maps integration.

3.Add Google Maps option meta box at the post or page edit screen.

4.Search load Google Maps ajax.

5.Get Google Maps latitude and longitude search location.

Genarte google map using ajax

6.Generate google maps -display_map short code.

7.Google Maps ShortCode (i.e [display_map] )usage.

Display google map using short code.

8.Generate unique map id to use different Google Maps on same page.

Hopefully, in this article, you have learned how to add “Google Maps” for your WordPress website, then please Subscribe to ScriptHere.Com by Email. You can also find us on Facebook and Twitter.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.