wp-weather

Latest version: 0.3.8
Please update to the latest version. I apologize for the rash of updates, but this version should fix all issues while allowing multiple forecasts to be used. Hopefully this will be the final update for quite some time.

Download link: http://wordpress.org/extend/plugins/wp-weather/

I have been using weather.com’s XML web service to display local weather information on my family website for several years. I decided to make the PHP code into a widget for wordpress. Here’s where you sign up for their service: http://www.weather.com/services/xmloap.html

This widget uses a database table to cache the data for a half hour to avoid hammering the web service. Additionally, if you are using the wp-cache plugin, any changes to the options clear the cache.

To install: upload to your plugin directory, activate the plugin, set the options and add the widget to your sidebar. Your location ID is a zip code for US and an alphanumeric code for international. Take Dublin for example – when searching for Dublin on weather.com you are taken to the following page: http://www.weather.com/weather/today/Dublin+Ireland+EIXX0014 and EIXX0014 is the location code.

Additionally, you may use a shortcode on any post or page.
[weather_display]
If you want to show different cities on different pages/posts you can specify a location id:
[weather_display location_id="75034"]
If you’d like to display more days than default (what you set in the plugin options page):
[weather_display forecast_length=5]

weather.com has made changes to their servers which now REQUIRE you to enter a partner id and license key in this plugin’s settings. If you do not, they will not send the complete forecast data which in turn will break this plugin.

Preview:

221 responses to “wp-weather”

  1. Csaba

    Works. Thanks.

  2. Diyana

    Added the plugin widget, it appears on my website, but no weather details. Where do I insert my country in order to make it appear?

    Thanks!

  3. diyana

    Is there no location ID for Kuala Lumpur, Malaysia?

  4. Diyana

    Ahh, it works!

    Coolness!

    Thanks very much!

    :)

  5. Chris

    Hi Matt

    I ‘m wanting to use you plugin but in a different way to how it is currently designed, and wondered if you could tell me whether its possible.

    I have a blog that reviews walking locations, and therefore I don’t want to set a location as such. I want the location to be different for every post. Is it therefore possible to call the function with a different location setting…
    - show the weather for Somerset here http://tr.im/LRCY
    - show the weather for Sheffield here http://tr.im/LRD9

    Much appreciated

  6. Chris

    Thanks Matt

    I’ve already tried playing around a bit, removing the Location ID in the settings menu, and then trying to add it in the post directly using:
    [weather_display location_id=UKXX0446]

    Excuse my lame attempts… but it didn’t work :(

  7. Elena Coen

    Please tell me where I can download the two plugins. The Analytics folder is empty and I can’t find the Weather one. Thanks so much, Elena.

  8. Craig

    Hey Matt! Great plugin/widget! Just one thing though! I’m wanting the 64×64 graphic to be placed to the right of the forecast and not below it. Is this possible? Could you tell me how to do this? Much appreciated!

  9. Rodger Gallagher

    Until the last two recent upgrades to the plugin, everything worked fine.

    Now it starts showing the weather one day in the past.

    If I go to the settings page and click on ‘Save Changes’, without changing anything then the correct weather day is shown.

    My website is in the Pacific/ Auckland time zone and my server is Dreamhost in the US.

  10. Craig

    Thanks, Matt. I found the line of code of the small graphic, but how do I change the position of the graphic to the right of the forecast? Do I add properties inside the img tag? I’m not too familiar with PHP :-/

  11. Chris

    Matt

    Since the last upgrade (3.6 I think), I’ve started getting errors. Annoyingly I copyed the error but I’ve since copied some other text :(

    From memory it said something like:
    Duplicate location UK0000044 Invalid XML

    To fix it, I went back into the plugin, and re-svaed the details, but this has to be done everytime I add a new post.