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:

Good idea for a plugin and widget but why not link to The Weather Network for users that live outside the US?
Weather.com can accommodate international cities. Just find your appropriate city code.
What code would I need to insert to add this to a static page on my blog?
Great plug-in! Just a couple of suggestions:
1. You might want to use .gif files instead of .png for the weather icons. Due to an error in IE 6 (and, I think earlier versions), .png files don’t display transparencies. I had to convert the files to .gifs (with photoshop) in order for them to display properly.
2. It would be great to have the ability to display two different cities.
Thanks!
Is there any way to place the three day forecasts side by side?
Alicia – out of the box this functionality is not supported. You can edit the file to remove the paragraph and line break tags.
Was working fine for months, then suddenly, overnight, I’m running into the same error that DesiTech refers to above…
Fatal error: Call to a member function on a non-object in …/wp-content/plugins/wp-weather.php on line 313
So I updated to the most recent version of your plugin but I’m still getting the problem, only now it points to line 366 as the culprit. Was this ever resolved? I don’t understand why it would happen overnight like that. I’ve deactivated all the other plugins, but I’m still getting the error. Please help!
Stefan – can you confirm if your host is running php 4? The author of the class i use in php 4 instances has mentioned this error in his documentation but i can not reproduce in my own environment.
Same thing here as Stefan, all was fine yesterday and today I get the same error. Nothing has changed on the page.
Fatal error: Call to a member function on a non-object
weather.com changed their url parameter format this morning. Version 0.2.7 fixes this. Without this version of the plugin the forecast data will be missing from the weather.com xml feed. Please update to this version and report if it fixes your issue.
I updated and still get the error:
Fatal error: Call to a member function on a non-object in /wp-content/plugins/wp-weather/wp-weather.php on line 366
yes, currently php 4.3.11, host reports no recent changes on the server side, so still baffled as to why it should work fine for months, then suddenly stop working… could be a weather variable that hasn’t occurred for the past several months?
woops, sorry — didn’t see that you had responded — but yes, I’m using version 0.2.7, and its still not working.
I’m getting the same error as stefan. Worked monday, stopped tuesday. At first on version 0.2.6, then updated to 0.2.7…same line is calling the error “$days = $day_forecast->children();” on line 366.
Do you guys have a valid license key and partner id saved in the settings? I know previously they let you access the xml feed without one, but they clamped down on that Monday and require one now. Without these, you won’t get the full xml data which will cause the call to ->children() to fail.