Skip to content

Instantly share code, notes, and snippets.

Created Apr 26, 2016
What would you like to do?
Google Map Embed in WordPress Post / Page
// Google Map embed short code
// Usage: [googlemap src="you_url"]
function GoogleMapEmbed($atts, $content = null) {
"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