You can use the WP Geo widget to display a map in your sidebar. This will display markers for all currently visible posts. If you are on a post page it will display one marker and if you are viewing a category or archive page it will display a marker for each post on that page with location information.

Widget Widget (with rollover)

In the WP Geo settings you can set a default map zoom. The widget will always zoom out so that you can view all the markers it is displaying, but if it is only showing 1 marker or a couple of markers close together, it will never zoom in further than the Default Map Zoom you set in the settings.

Settings - Default Map Zoom

Settings - Polylines

By default, the widget will use the polyline settings you have set in the main WP Geo settings. Here you can trun polylines on or off and set the colour of polylines.

When adding a widget, you can override show of the default settings and customise the look of the widget.

Widget Options

You can add a map title which will appear above the widget.

You can set the dimensions of the widget. I suggest for most themes you will want to set the width to 100% so the map stretches to the same width as your sidebar. However, you may find that with some themes this does not appear as expected and you may need to set an exact width.

By default, the widget will display the same type of map as you have set in your main WP Geo settings. You can override this by selecting a different map type in the widget’s menu. You can also choose to override the default polyline setting.

23 Responses to “WP Geo Widget”

  1. Martin says:

    Hi,

    is there any way to modify the widget that it only shows the last position? I mean the location of the last post.

    Thanks in advance,
    Martin

  2. Denise says:

    Hi,

    Your plugin is great.
    Any reason why the widget only shows on the index page ?

    If you load any ohter page it disappears from the footer bar or sidebar.

    I am using Arthemia 2 theme & Wp Geo 3.0.9.1

    Thanks in advance

    Denise

  3. erwan says:

    Hi, I don’t know about your plans for the future but below is a modified code of the widget that uses the have_posts loop, replacing the loop on the posts variable. I found it easier that way.What do you think

    ` if ( have_posts() ) while ( have_posts() ) { the_post() ;
    //for ( $i = 0; $i ID);
    $title = get_post_meta(get_the_ID(), WPGEO_TITLE_META, true);
    if ( empty($title) ) {
    $title = get_the_title();
    }

    if ( is_numeric($latitude) && is_numeric($longitude) ) {
    $push = array(
    ‘id’ => $post->ID,
    ‘latitude’ => $latitude,
    ‘longitude’ => $longitude,
    ‘title’ => $title,
    ‘post’ => $post
    );
    array_push($coords, $push);
    }

    }`

  4. Jonas says:

    Hi Ben,

    I just found your plugin for WP-GEO, and it looks great. I’m just wondering if there’s a way to setup the widget-map to keep the latest zoom level changed by user, instead of refreshing into the default values once I click on a marker to open a post.

    My intention is to have the widget-map “remembering” the last position even after I clicked into the marker thus reloading a post. Seem that the widget is reloading each time clicked.

    Thanks!

    /Jonas

  5. el forastero says:

    Is it possible to have all the markers in the map (like the mashup) AND a list of all the places in the map sorted by countries&

    • Ben says:

      WP Geo does not current find out or store countries where the markers are placed. It should be possible to extend the plugin or create a new plugin to look the countries for a posts coordinates and store this as post meta data. You’d then be able to sort the posts based on that meta data.

      I don’t have time to build the functionality but if anyone else is willing to I’ll be happy to help/advise.

    • el forastero says:

      Thankyou for the answer Ben, the plugin is really cool. If is not possible to sort the info by countries, is it possible just to print the list as text?

  6. Markus says:

    Hi,
    since I update the Atahualpa theme, the widget doesnt work anymore. Any ideas???

  7. Brian says:

    Hi,

    Nice widget; however, when using the WP Geo Contextual Map in a Woothemes Canvas theme….the WP Geo Contextual Map doesn’t seem to show up at all when using a custom sidebar for that theme. http://www.localjobs.com/blog/cities/knoxville-business-news/

    However, it WILL show up if I activate a map for the page itself, but that’s just a map then of say the city…and not of the individual posts showing on the page. Any ideas?

  8. Brian says:

    Ummm. This is our live blog. Not sure I want to potentially damage the pages that we have in place. Let me see if I can’t get our dev site to replicate the same theme / environment….and THEN, I’ll try the dev version.

  9. coxinette says:

    i’ve found this plungin great…. but i’ve got a really problem… the manual shortcut [wp_geo_map] doesn’t function… the map doesn’t appear >< maybe there's a solution???

  10. Markus says:

    after latest updates the widget is displayed again.
    only drawback: the setting for the color of the polyline is ignored by the widget. color is always white (which can hardly be seen on the maps)

  11. Monsoon says:

    Is there any chance you could add a default zoom option for the widget?

    The widget zoom level overwrites the one saved for by the page. Lets say I have default 5 on the plug in setting and level 1 on the page where the plugin is. If I view that page the zoom will be 5 and not 1.

    The plugin does not seem to care what settings are on the post/page…is this normal?

    • Monsoon says:

      Sorry I wasn t clear enough I think. I mean that the widget zoom level overides the post or page zoom level.

      So lets say I have a page showing a restaurant I need full zoom on the street but if I have a country I need full zoom out.

      The settings to “Save custom map zoom for this post” do not work and are always overwritten so I do not know if instead of using the widget it is better to use something else like a shortcode?

      Please advise

    • Ben says:

      The widgets can be used to display multiple map points on certain pages which is why they only use the setting you set in the admin.

      The custom map zoom value only affects shortcodes and template tags to show the map in individual posts.

      If you require the widget zoom to change on single post pages I may be able to write some code to do that. Please contact me if you would like me to do this.

  12. Roei says:

    Hi,

    I am testing this plugin on on a virtual machine on my local computer, and the widget doesn’t show. Also, tried to install the ‘development version’ suggested earlier, but that also doesn’t work.

    Please advice.

  13. kusumtwr says:

    HI Ben

    I am trying to use this plugin for my business directory site where i am using a custom theme which has Two custom Post type and another one custom post Diretory generated by Business Directory Plugin. and Directory is being rendered at a Page where [short code] for Directory is pasted.

    what i am facing 1. it is not rendering any MAP on custom post Directory,
    it is also not showing markers from custom post to Mesh up Maps .

    Please suggest

    @kusum

    • Ben says:

      Do you have a test URL where I can see the site?

      With mashup maps I think by default it will only get posts like the WordPress get_post() function. Have you tried specifying a post_type? A mashup map should be able to the same parameters as get_posts().

  14. iMat2.9 says:

    Is it possible for the “WP Geo Recent Locations” Widget to display the custom marker icons from the posts, instead of the small marker?

Leave a Reply