1

I want add Google Maps for my index page on a Wordpress site I'm designing. I've been looking everywhere for this but I can only find plugins that allows me to add to posts and pages. That's not what I want.

I want a map that looks like map 10 here:

http://gis.yohman.com/blog/2010/10/27/wordpress-plugin-google-maps-shortcode/

On my first page. How do I do that? I tried to install this plugin then add:

< ?php echo do_shortcode ( '[shortcode goes here..]' ); ?>

on my index.php. But that doesn't work. What shall I do? Please help me.

2 Answers 2

2

Forget about plugins and WordPress specific stuff, why overly complicate adding one thing to one page?

Get the Google Maps code directly from the Google Maps website.

Add it to your index.php template file where you want the map to appear.

If your index.php template is used for more than just the home page, copy its contents to home.php, which is the template file WordPress will use only for your homepage if it exists.

5
  • Thanks! Didn't think about that. I just have one problem, I don't that this white bubble with information about direction and stuff. How do I remove this one?
    – Andreas
    Commented Feb 9, 2011 at 14:04
  • I don't know what bubble youre talking about, but it's probably in the code you copied, so delete it! Commented Feb 9, 2011 at 14:05
  • When i embed the google map i get a white bubble/ballon (not sure about the correct english word here) which points to the location. In this bubble/ballon there is information about the address, directions and so on. I don't know to remove this from the code.. Anyone who knows?
    – Andreas
    Commented Feb 9, 2011 at 14:24
  • Edit your question to include the code you want help editing. We can't guess. Commented Feb 9, 2011 at 14:25
  • Can't put the code here cause it's to long... But u can go to maps.google.se and search for "Stockholm". if u take that embedded code there you'll se the code I'm trying to add to my page
    – Andreas
    Commented Feb 9, 2011 at 14:53
0

*Updated for 2017
Another quick and easy way is to just embed Google Maps directly to your index page. In the HTML options.

  1. Go to https://www.google.com/maps
  2. Search and find your starting point of the map that you wish
  3. Click the menu icon on the top left
  4. Click "Share or embed map" option in menu
  5. Then in the top right, click the "Embed Map" option
  6. Copy the given code. Should start with an iframe.
  7. Go to your index page in WordPress.
  8. Click "Text" option in top right, also called HTML.
  9. Paste this code in area that you wish.

P.S: If you want to style or edit the embedded map you can change the width=" " and the height=" " to your desired dimensions. If you want more styling options, there are some things that you can do with CSS classes and IDs, but anything extravagant will require use of the Google Maps API.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.