Support » Fixing WordPress » Google Maps in WP

  • I am a beginner with all this stuff – but want a map in my blog – I have got an API key from google, and loaded up a GEO php into my plugins and activated it.
    I tried to load up the beginner map with the code supplied from Google into:
    Write Page, Page content (also the HTML box)
    to get me started.. but although there seems to be white space, nothing shows up.?
    I’m sure I’m doing something very basic wrong.
    Can someone give me a ‘simple’ step by step as to where you load the code.. etc.
    I’m using Pool 1.0.7 as my theme..
    Please help. Thanks

Viewing 12 replies - 1 through 12 (of 12 total)
  • If the code is PHP code, I believe you’d need a plugin such as:
    RunPHP Plugin
    Don’t forget to check the “run PHP code?” box on the Write Post and Write Page area.

    QuickPHP is really targeted for single function calls or include statements (it does one ‘method’, with a parenthesized parameter list), constant arguments. But including a php script is then really easy, or calling a function (like any basic WP func..).

    The author, David Chait, uses it for embedding things like CG-FeedRead feeds, or wacky CG-Amazon stuff (since CG-Inline already has an amazon tag).

    PHPExec Plugin

    Additional info:

    Thanks for your help.
    I have done what you suggest and downloaded the RunPHP Plugin. Followed all the directions.. but still not a map in sight when I come to writing the page!

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    The code Google gives is Javascript code, I believe. In which case you’ll need something to allow you to put scripts into posts without WP hosing them up like it normally does.

    I wrote a plugin to let me do just that a while back:

    Basically it just prevents WordPress’s formatting functions from messing with script code in posts.

    Thanks Otto.
    Done that – and again nothing. Do I need to de-activate the php stuff previously activated?

    Moderator Samuel Wood (Otto)

    (@otto42) Admin


    But it might be helpful if you tell us what code you’re putting where and how. The shotgun approach obviously isn’t working.

    For sure.
    When Google maps thank you for signing up for a google maps AIP key, they give you an example web page to get you started on your way to ‘mapping glory’. (Pasted below)
    It includes my key, that they say is good for all URLs in my directory:
    I assumed that once that was up – I could then edit as I worked through the instructions. Obviously not that easy!
    Does that help explain Otto?
    I really appreciate the help if you have any other suggestions. Thanks

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
    <html xmlns=””>
    <meta http-equiv=”content-type” content=”text/html; charset=utf-8″/>
    <title>Google Maps JavaScript API Example</title>
    <script src=””
    <script type=”text/javascript”>


    function load() {
    if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById(“map”));
    map.setCenter(new GLatLng(37.4419, -122.1419), 13);

    <body onload=”load()” onunload=”GUnload()”>
    <div id=”map” style=”width: 500px; height: 300px”></div>

    We have actually been working on something that allows Google Maps to be added to your site with some HTML code. Although it’s almost complete, I’m hesitant to give the URL just yet because it has a few final tweaks being done to it. If you’d like details, email me on dedicate at dedicate dot co dot uk and I’ll get back to you in about a week’s time with the info.


    Oh ok.. It’s not just me that’s having trouble adding Google maps to my site then, if you are writing code!?
    Will email you Paul, thanks. Em

    Here I’ll teach the simplest way to embed google maps on your postings:

    You can see the example here:

    * easy, easy, easy to use
    * support for setting overlay maps, map types, etc..
    * unlimited number of maps on single page
    * one marker per map
    * support for English and Japanese map captions (on map buttons)
    * uses Google Maps API v.2

    You can find the author of the plugin here:

    remember that wordpress creates directories on the fly for posts… so your post may not live in the directory you have a key for.

    I’ve implemented a google map by placing it in a fixed file and including that into the template files, as in the sidebar, index, whatever…

    additionally, do you have custom permalinks set up? that also may be changing the actual directory structure for where the map displays. The key is only good for a page IN blog/

    not in blog/2006/august/my-post-with-map

    If you use Windows Live Writer, you WON’T have trouble with maps in posts.

    [Aside from the fact that they don’t come close to validating, of course….]

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Google Maps in WP’ is closed to new replies.