Latest version: 0.3.7
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.
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.
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:

Matt
Got the error code as for some reason its just started showing again, without any updates or changes since I thought I’d fixed it:
Invalid query: Duplicate entry ‘UKXX0446′ for key 1
Depending which page I load, the UKXX0446 changes according to the location.
I’ve had to disable the plugin for now so my site continues to work.
Hi Matt
Thanks for doing the lates update. As per the comment for Chris, I have the same rror message:
Invalid query: Duplicate entry ‘NZXX0013′ for key 1
When I go to the Settings page and click, ‘Save’ without updating anything, it then works OK.
Regards,
Rodger
All, I think I have a fix worked out as I’ve identified an issue with a sql query. Once I receive word back from a tester, I’ll push out the update to wordpress.org. Hopefully this will be the last one for a while.
Thanks Matt. Last lot of fine tuning has it fixed.
Hi. I’m working on a WordPress site and I’l like to use your widget. I obtained the partner id and license key from Weather.com, but get this in place of where the widget should be…
WARNING isterxmlexpatnonvalid->parse(): expat: no element found [-1/0/1]
Incomplete forecast XML received.
Please refresh your browser.
Any thoughts on how to resolve this?
Thanks!
Ali — this error means that there is no forecast data to display. Did a refresh of the browser work? Have you set the appropriate location code, license key and partner id in the settings?
is there php code to hard code the weather applet?
Leo – you can use the shortcode [weather_display] in your posts/pages or use
in your sidebar/footer/etc.