How To inserting Google Maps into WordPress


Sponsored Links




Today Tutorial is How To inserting Google Maps into WordPress Posts/Pages without Plugin, we only need to write Google Maps shortcode and we can put our own maps with really easy ways. The first time is write down this code below in your theme functions.php and we need to put the shortcode in our post/page with some parameters.

Code To Inserting Google Maps using shortcode

//Google Maps Shortcode
function do_googleMaps($atts, $content = null) {
   extract(shortcode_atts(array(
      "width" => '640',
      "height" => '480',
      "src" => ''
   ), $atts));
   return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'&amp;output=embed" ></iframe>';
}
add_shortcode("googlemap", "do_googleMaps");

You can change the width and height what ever you want. Just replace on the code above. Now it’s time to practice, to use this shortcode is easy, just write down

[googlemap width="200" height="200" src="[you_url]"]

You can Replace [you_url] with you Google Maps Link, check this screen shot for more details

How To inserting Google Maps into WordPress

How To inserting Google Maps into WordPress

There are another method by using Inline Google Maps WordPress Plugin, if you need some tutorial about Google Maps Plugin version you can tried using this tutorial, thanks for DigWP to share this tricks.

Right now, many user using Google Maps to added more unique content to their visitor, such as added real address with Maps and many more.

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net


22 Responses to How To inserting Google Maps into WordPress

  1. Pingback: How To inserting Google Maps into WordPress / Quote Of The Day

  2. George says:

    There is not need to do it this way. YOu can add Google maps very easily with Google Chrome’s extension Zemanta. It shows right next to any post you are edinting. All you do is type the address inside any article post, and automatically a map shows up on the right column (zemanta). You click on it and done!!

    I only do coding for things that are worth spending time with.

    I recently added a Google map for a Tampa, fl. location. On this clien’s blog (no coding). http://scolibracing.com/

    George.
    Web developer/Digital Marketer specialist.

  3. Pingback: » How To inserting Google Maps into WordPress – The Easy way.

  4. Pingback: wp-popular.com » Blog Archive » How To inserting Google Maps into WordPress # WordPress Tricks & Tips

  5. Emilio says:

    Thanks for the post.

    I followed your instructions and had no problem getting the maps to display. The only thing is in your example you give a different width and height in the short code. I changed those numbers to match the map width and height I used in the functions PHP file. I also had to remove two brackets in the shortcode surrounding the url.

    Using functions.php like this beats using a plugin any day.

    Thanks again,
    Emilio

  6. Pingback: Razee » Blog Archive » How to Add a map to a WordPress post or page

  7. cherrypicker says:

    Thanks! Neat solution to common problem, I’ll be adding maps to loads of pots now!!

  8. Pingback: 20 Plugin Replacing Tutorials, Tips, Snippets and Solutions for WordPress | FlexLib

  9. Pingback: 20 Plugin Replacing Tutorials, Tips, Snippets and Solutions for WordPress « Free UK Web Design

  10. Pingback: 20 Plugin Replacing Tutorials, Tips, Snippets and Solutions for WordPress | Typography Blog

  11. Pingback: 20 Plugin Replacing Tutorials, Tips, Snippets and Solutions for WordPress | Speckyboy Design Magazine

  12. hi.. nice plugin.. thanks.. i use it on my site,, and look wonderfull, thanks.. :)

  13. Pingback: 20 WordPress Theme Hacks to replace the need for Plugins | JC

  14. Pingback: The Creative Solution to Insert Google Analytics on WordPress | WordPress News Wire

  15. cancel says:

    Thanks for sharing

  16. Roch says:

    Is there a way to have an embed Bing map of bing using the bird’s eye view but zoomed out? The default zoom is too close and can’t really show the whole neighborhood.

  17. Pingback: 10 полезных уроков для wordpress

  18. Pingback: 20 Plugin Replacing Tutorials, Tips, Snippets and Solutions for WordPress « DownGraf – Design weblog for designers

  19. F Scheltens says:

    Thanks for showing me this! I had a shortcode like this on my old blog at wordpress.com and i couldn’t figure out how to do it on my new blog until i read this.
    By the way you can do this without the quotes around the numbers for width and height: i.e. width=200. The url is TEXT and does require quotes.

  20. Pingback: 15 Hacks to Pimp Your WordPress Website | Template Monster Blog

  21. Pingback: 15 Hacks to Pimp Your WordPress Website « CSS Tips

  22. Pingback: 15 Fresh and Useful Wordpress Hacks/Snippets | gonzoblog.nl

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>