Wordpress Google Map Shortcode


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <!-- Put in functions.php file -->
  2.  
  3. //Google Maps Shortcode
  4. function fn_googleMaps($atts, $content = null) {
  5. extract(shortcode_atts(array(
  6. "width" => '640',
  7. "height" => '480',
  8. "src" => ''
  9. ), $atts));
  10. return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'"></iframe>';
  11. }
  12. add_shortcode("googlemap", "fn_googleMaps");
  13.  
  14.  
  15. <!-- Usage inside Post/Page: -->
  16. [googlemap width="200" height="200" src="[url]"]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.