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:

Works. Thanks.
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!
Is there no location ID for Kuala Lumpur, Malaysia?
Diyana, I show MYXX0008 as the location ID for Kuala Lumpur. Please let me know if this does not work.
Ahh, it works!
Coolness!
Thanks very much!
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
Chris – that functionality isn’t available currently. However, it shouldn’t be too hard to add a location id parameter to the shortcode that will render the weather. Let me see about getting an update out.
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
Chris, I did some major modifications and got the shortcode now handling different locations in a post or page.
Update your copy and try [weather_display location_id="UKXX0446"] — note the quotes around the actual location id.
Cheers.
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.
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!
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.
Elena – I’ve added the download link to the top of this page.
Craig – You’ll have to customize the output in the plugin file. If you’re on PHP5 then it will be around line 270, otherwise line 373.
Rodger – I tracked down the bug. When a stale forecast is in the database, I was deleting the row but the code still used that old forecast data for display. Usually a refresh of the page would fix it, but that’s a bug so I’ll be releasing another update to take care of that. Thanks for the heads up!
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 :-/
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.