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. Gene

    Good idea for a plugin and widget but why not link to The Weather Network for users that live outside the US?

  2. Alicia

    What code would I need to insert to add this to a static page on my blog?

  3. AnotherPerson

    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!

  4. Alicia

    Is there any way to place the three day forecasts side by side?

  5. stefan

    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!

  6. PB

    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

  7. PB

    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

  8. stefan

    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?

  9. stefan

    woops, sorry — didn’t see that you had responded — but yes, I’m using version 0.2.7, and its still not working.

  10. Cassie

    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.

1 ... 3 4 5 6 7 ... 15