How to Insert Google Maps into WordPress

Right now, many people are using Google Maps to add more unique content to their visitors, such as showing their location of their business or event.

Today’s tutorial is how to insert Google Maps into WordPressPosts/Pages without a Plugin, we first need to write a Google Maps shortcodeand we can put our own maps easily into our WordPress posts.

The first time we write the code below in your theme functions.php and then we need to put the shortcode in our post/page with some parameters.
Code To Inserting Google Maps using shortcode
//Google Maps Shortcode function do_googleMaps($atts, $content = null) { extract(shortcode_atts(array( "width" => '640', "height" => '480', "src" => '' ), $atts)); return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'&amp;output=embed" ></iframe>'; } add_shortcode("googlemap", "do_googleMaps"); You can change the width and height to what ever you want. Just replace it in the code above.

Now it’s time to practice, to use this shortcode is easy, just write in your post/page
[googlemap width="200" height="200" src="[you_url]"] You can Replace [you_url] with your Google Maps Link


Readers Comments

Find Us On Facebook

Latest Posts

Featured Video

Our Sponsors

Our Sponsors

Visit Nepal Info and Guide