Google Maps Shortcode


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

Shortcode: [googlemap width="200" height="200" src="[url]"]


Copy this code and paste it in your HTML
  1. // function
  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.'"></iframe>';
  9. }
  10. add_shortcode("googlemap", "fn_googleMaps");

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.