fbpx

How To Display Weather On A WordPress Blog

I am working with the owners of a blog who provide a news service to a resort island in the southern henisphere, and part of hteir requirements was a weather update on the top of their blog.

This is the first time I have been called upon to do this, so I though I would share my findings with you lot.

Weather Services

There are a number of weather services out there who coallate reports and make them available as web services.  This seemed the best bet, plugin to one of these services and use their data.

The eventual service I chose was http://www.accuweather.com/

Match Weather Services with a plugin

Once I had selected my weather service, the next step was to either write some code to pull in the data from Accuweather or to find a plugin that did it already.  I’m all for not re-inventing the wheel, and I found a number of plugins that used Accuweather.  I finally selected wp-forecast http://wordpress.org/extend/plugins/wp-forecast/

I chose this because it had the ability to code the weather into the theme through php calls along with widgets.  The level of data provided was very good, and it looked great on my clients site.

Configuration

WP_forecast is a fairly simple thing to use, install it in the normal plugin fashion, then retrieve your location from Accuweather.  It will come in a format similar to this:

EUR|UK|UK179|NEWCASTLE|

I simply searched on the homepage for my city, and this code was appended to the end of the URL, a quick cut and paste, and I had weather for cold old Newcastle-upon-Tyne.

There is a lot of data to add from temperature, wind speed and direction, humidity and loads more.  A very thorough service.

The Current Eeather In Sunny Newcastle UK Is:

I installed wp-forecast on my blog and screen captured a view of the widget so you can see what it looks like

And That’s The Weather For Today

Having a weather forecast may not be everyone’s thing, but if your blog is the front end for a bricks and mortar site, where people come and do things (can I be more vague) then this may be for you.

Leave a Reply

Your email address will not be published. Required fields are marked *