Get accurate and beautiful weather forecasts powered by Wunderground.com
Wunderground.com has the most accurate and in-depth weather information. They’re also not evil corporate giants, and are weather geeks, which is nice. This plugin uses the Wunderground API for its accurate forecasts.
This is the best-looking weather forecast plugin for WordPress. It looks great on many different templates out of the box, including the default WP theme.
Learn about setting up the plugin, how to configure the shortcode, template overrides and more on the plugin info page.
Weather Underground has challenged the conventions around how weather information is shared with the public since 1993. We’re immensely proud of the unique products that our community and meteorologists have created to improve people’s access to meaningful weather data from around the globe. As the Internet’s 1st weather service, we consider ourselves pioneers within our field and we’re constantly seeking new data sets and the next technologies that will help us share more data with more people.
Weather Underground is a registered trademark of The Weather Channel, LLC. both in the United States and internationally. The Weather Underground Logo is a trademark of Weather Underground, LLC.
[wunderground]
“shortcode” as described on the plugin page’s Shortcode Parameter guide.[wunderground]
“shortcode” as described on the plugin page’s Shortcode Parameter guide.Version 2.0 got rid of the default settings page; now shortcodes and widgets are configured individually.
Version 2.0 made lots of changes as to how the forecast is displayed. You can download the last update of the “1.x” version of the plugin here: Version 1.2.5.1
If your location isn’t working any more, follow the steps below:
http://www.wunderground.com/q/zmw:00000.4.17340
/q/
. In this example, it would be zmw:00000.4.17340
[wunderground location="zmw:00000.4.17340" /]
Weather Underground has generously donated free API access to users of this plugin.
If you prefer, you can define your own API key in your installation’s wp-config.php
file by setting a WUNDERGROUND_API_KEY
constant, like so:
define( 'WUNDERGROUND_API_KEY', 'myapikey' );
You can also override the API key using the wunderground_api_key
filter, like so:
add_filter( 'wunderground_api_key', 'my_custom_wunderground_api_key' ); /** * Use my own API key! * @return string My API key */ function wunderground_api_key( $old_api_key = '' ) { return 'myapikey'; }
If you want to use your own icons, you would add a filter to the bottom of your theme’s functions.php
file. See a list of icons you should have available. Here’s sample code:
add_filter('wp_wunderground_forecast_icon', 'use_custom_wunderground_icons', 10, 2 ); /** * @return string URL to the root folder of the icon set. */ function use_custom_wunderground_icons( $url_base = '', $icon_name = '' ) { return 'http://icons.wxug.com/i/c/a/'; }
Please see the “Using your own template” section on the Plugin Github page
The output of the widget is cached for speed. Add ?debug
to the URL and it will refresh.
You can also add add_filter( 'wunderground_twig_debug' '__return_true' );
to your functions.php file to disable caching during development. Only disable caching when absolutely necessary; it will slow down your site.
This plugin is released under a GPL license. Weather Underground is a registered trademark of The Weather Channel, LLC. both in the United States and internationally. The Weather Underground Logo is a trademark of Weather Underground, LLC.
Weather Underground has been very gracious and has provided the plugin with free data – you don’t need your own account. If you want to use Wunderground data in your own application, register for a Weather Underground API account.
wunderground_api_key
filter or the WUNDERGROUND_API_KEY
constantwunderground_include_pws
filter to toggle whether to include Personal Weather Stations as data sources (Default: false, unless the location requested is specifically a PWS station)<thead>
code in table-horizontal.html
templatealt
text for icon when using the Current templatelanguage
parameters in the shortcode (fr
, not only FR
)<table>
tagincredible
didn’t work, since the plugin expected Incredible
. (reported here)<table cellspacing="0">
with CSSwunderground_get_date_format()
)[forecast]
and [wunderground]
shortcodes in Text widgets by adding a do_shortcode
filter on widgets. This had been enabled in Version 1.x.wp_wunderground_forecast
filter to be backward-compatible with Version 1.xhidedata
shortcode parameter wasn’t working properly%%day%%
%%month%%
and %%year%%
placeholder tags[forecast]
shortcode with no parameters.datelabel
parameter for backward compatibilitywunderground_get_date_format()
function to process date formatwunderground_parse_atts()
wunderground_autocomplete_country_code
filter and returning a country code.table-horizontal
layout now workssimple
template updated to use Chance of Precipitation translation stringnumdays
is always less than 10hidedata
attribute that works like showdata
, but in reverse. By default, all items are shown when embedding the shortcode (conditions, precipitation %, icon, etc). If you want to hide the icon, for example, you would add hidedata="icon"
to the shortcode.wunderground_twig_debug
filter. You can force Twig debug mode by adding add_filter( 'wunderground_twig_debug' '__return_true' );
to your theme’s functions.php
file. You can also enable debug mode if you’re logged in as an Administrator by adding ?debug
to your current page’s URL.location_title
parameter. Setting location_title
overwrites that location that is displayed in the search bar, so that if your location is “ugly”, like longitude/latitude, you can overwrite that.simplexml_load_file
to wp_remote_fopen
and simplexml_load_string
(thanks, rjune)cache
option has been added to the shortcode. Add cache=0
or cache=
to the shortcode to disable storing forecasts. Not recommended; will dramatically slow down site. ?cache=false
to your URL and the forecast will be updated.100%
is the default. Use width=0
or width=
to disable hard-coding width in table.wp_wunderground_forecast_cache
– How long results are cached for. Default: 6 hours.wp_wunderground_forecast_icon
wp_wunderground_forecast_conditions
wp_wunderground_forecast_temp
16.66666667%
, it’s now 16.67%
simplexml_load_file
, which are required for the plugin.