WordPress.org

Ready to get started?Download WordPress

Forums

Error embedding google maps (7 posts)

  1. nwkmedia
    Member
    Posted 4 years ago #

    I am trying to add a google map to my blog http://www.osbornhomes.co.uk/wordpress/category/previous-housing-developments/hadlow-down-uckfield-sussex-homes/
    I have followed the instructions on http://en.support.wordpress.com/google-maps/ which are a touch confusing. I get the code from google maps, but the instructions on the link above says add it to the visual editor, but the screenshot shows the html editor. I have tried it in both the editors and it does not provide the shortcode. Has anyone else had problems with this?

  2. Darrell Schauss
    Member
    Posted 4 years ago #

    Those instructions are for WordPress.com. Are you using a WordPress.com blog or have your own install of wordpress?
    Wordpress.com forum http://en.forums.wordpress.com/

    I embed google maps into custom fields so the editor doesn't mess with it. And create custom page template to pull the custom field.

    I found this code from a plugin (waste of plugin in my opinion for such little code).

    I haven't tried it but you could put this in your functions.php (or install the plugin)

    function customfields_shortcode($atts, $text) {
    	global $post;
    	return get_post_meta($post->ID, $text, true);
    }
    
    @add_shortcode('cf','customfields_shortcode');

    Then make a custom field called 'googlemap' to paste the code. Then use [cf]googlemap[/cf] in the post.

  3. nwkmedia
    Member
    Posted 4 years ago #

    Hi,
    Cheers for that. I ended up adding it as a plugin as when I added it to functions.php, it "broke" the site. I am not sure why.
    It works like a dream. I am still finding my feet with wordpress, using it a cms system for clients.

    Stuart.

  4. nwkmedia
    Member
    Posted 4 years ago #

    Hi,
    I am not sure if this is related to the custom field, but when you click on a link to a post containing the embedded map, it links to the embedded map at the bottom of the page, once the map loads rather than the usual top of page. If you visit, http://www.osbornhomes.co.uk/wordpress/ and click the link to East Grinstead on th right hand menu, you will see it initially goes to the top of the page, but moves down to the bottom, once the page loads.
    Any ideas?

    Stuart.

  5. nwkmedia
    Member
    Posted 4 years ago #

    Hi,
    I found a similar post reprting the same issue, but it didn't continue.
    http://wordpress.org/support/topic/page-opens-but-jumps-down-to-the-bottom-right-away?replies=2

    Stuart.

  6. Darrell Schauss
    Member
    Posted 4 years ago #

    edit: let me check this out again. i finally able to reproduce the issue.

    It definitely has to be fault of google maps as I created a long page with nothing but the google map embed and it jumped on me in IE8.

  7. nwkmedia
    Member
    Posted 4 years ago #

    Hi,
    Yes it appears to be only a problem with embedded street view maps in IE. The normal embedded google maps are fine.

    http://www.google.com/support/forum/p/maps/thread?tid=2de33de5d4fd3205&hl=en

    Thanks again for your help.

    Stuart.

Topic Closed

This topic has been closed to new replies.

About this Topic