How to add Google Maps to WordPress site (not posts or pages)

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:

Read More

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.

Related posts

Leave a Reply

2 comments

  1. 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.

  2. *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.