Wordpress,
How to Insert Google Maps into WordPress
Posted by Bijay Kuikel
Published on Monday, November 24, 2014
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 '';
}
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
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
Now it’s time to practice, to use this shortcode is easy, just write in your post/page
0 comments
Readers Comments