Skip to content

Instantly share code, notes, and snippets.

@blbwd
Created Apr 26, 2016
Embed
What would you like to do?
Google Map Embed in WordPress Post / Page
<?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