Google Maps Shortcode


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



Copy this code and paste it in your HTML
  1. //Google Maps Shortcode
  2. function fn_googleMaps($atts, $content = null) {
  3. extract(shortcode_atts(array(
  4. "width" => '640',
  5. "height" => '480',
  6. "src" => ''
  7. ), $atts));
  8. return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'&amp;output=embed"></iframe>';
  9. }
  10. add_shortcode("googlemap", "fn_googleMaps");
  11.  
  12.  
  13. [googlemap width="200" height="200" src="[url]"]

URL: http://digwp.com/2010/01/google-maps-shortcode/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.