Created
April 26, 2016 06:40
-
-
Save sanjaybhowmick/cfd67bc1f7cfea7c3c6b30e9a9690971 to your computer and use it in GitHub Desktop.
Google Map Embed in WordPress Post / Page
This file contains 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
<?php | |
// Google Map embed short code | |
// Usage: [googlemap src="you_url"] | |
function GoogleMapEmbed($atts, $content = null) { | |
extract(shortcode_atts(array( | |
"width" => '100%', | |
"height" => '480', | |
"src" => '' | |
), $atts)); | |
return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'" ></iframe>'; | |
} | |
add_shortcode("googlemap", "GoogleMapEmbed"); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment