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.
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 tohome.php
, which is the template file WordPress will use only for your homepage if it exists.*Updated for 2017
Another quick and easy way is to just embed Google Maps directly to your index page. In the HTML options.
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.