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. Rhon Fitzwater

    So their is no using this theme without having a widget compatible theme? I would really like to use the theme I hacked together and just be able to add some code to my sidebar.php file.
    Any chance this can happen? Thanks…

  2. Lindsey

    What code do I use to get it to show on my site? I’m using WP

  3. John Boyd

    Ditto to what Rhon said. I hate widgets and there are still a whole lot of people who avoid them like the plague. Would be nice if this didn’t require a “idget” ready theme. I’m sure there is a work around and just a matter of time before somebody posts it. If I were talented enough, I would.lol

  4. 1988er

    Fatal error: Cannot instantiate non-existent class: simplexmlelement in /srv/www/vhosts/sunsonic.de/subdomains/ardiem/httpdocs/1988er/wp-content/plugins/wp-weather/wp-weather.php on line 204

    thats what happens when i try to display the plugin on my blog :(

  5. Marc

    Hi,
    Is there any possibility that the temperature will be shown in Celsius as well.

    Thanks in advance,
    Marc

  6. Rhon Fitzwater

    Any chance the next version could have a 2-3 day forecast. It would be great if an effect like Yahoo.com has for their weather display could be used. I.E.: When you mouseover the current weather, it animated down to reveal the 3 day forecast.

  7. Rhon Fitzwater

    Please add the option to view the forecast for the next few days.

  8. Mike

    Marc: it is actually very easy to add whatever you want to this and change to metric.
    Just specify more in the $forecast_url
    $forecast_url = 'http://xoap.weather.com/weather/local/' . $location_id . '?cc=*&dayf=' .$forecast_length .'&prod=xoap&par=' . $partner_id . '&key=' . $license_key . '&ut=C&ud=k&us=k&up=m&ur=m';

    I am also working on localizing this for Chinese right now, the xml is fairly straight forward for how to add things you want

  9. Mike

    Hey Matt, (or anyone who can help with this one)
    I am getting annoying errors, which range from annoying to admin-panel destroying.

    Here’s my code for the translations, as you may notice, it is not complete yet due to a lack of a full list of what each graphic actually represents (that would be helpful)
    http://www.notaclue.ktcs.net/dev/wp-weather.txt

    The error I am getting is this:
    Warning: Cannot modify header information – headers already sent by (output started at /PATH/public_html/wp-content/plugins/wp-weather/wp-weather.php:1) in /PATH/public_html/wp-includes/pluggable.php on line 329

    I am stumped as I am not great with php and have been away from coding for a few years, any help is greatly appreciated.

    Thanks

  10. Mike

    welp, i’m an idiot.
    if anyone else is getting this problem, edit .htaccess and throw in
    PHP_FLAG output_buffering on

  11. Sharon

    I’m trying to get the weather widget working, and keep getting this error:

    WordPress database error: [Table 'hawaiibnb_com_2.wp_weatherxml' doesn't exist]

    Where can I find information on setting up this table in my database?

  12. yabbox

    Hi,

    Do you have a time schedule for making this work for PHP Version 4.3.11? I have the same error on line 204 as 1988er.

    As it isn’t working on my server, is it worth the wait – does the service work for places outside the US?

    Thanks,
    Andy