Easy Weather Widget

plugin banner

Version: 1.0

Author:Mat Gargano, StatenWeb (profile at wordpress.org)
WordPress version required:2.8
WordPress version tested:4.9.25
Plugin version:3.2.5
Added to WordPress repository:07-10-2012
Last updated:30-12-2017
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:86
Rated by:6
Plugin URI:
Total downloads:18 559
Active installs:100+
plugin download
Click to start download

Easy Weather Widget provides you with an easy to use widget which outputs weather information. When creating the widget just enter in your U.S. zip code and save, it will display the current weather on your site.

I completely rewrote the widget and made it filterable. You need to obtain and enter an API key, which has a free tier that should cover many use cases to obtain at Settings > General in your WP backend. See http://openweathermap.org/api for more information.

The following filters are available:

eww_template to override the output template for the widget, see below for more information.

note, if you are overriding the template, please heed the notice to comply with the OpneWeatherMap license which states the OpenWeatherMap name must be mentioned as a weather source in a visible part of the application. (obtained 8/2016 from http://openweathermap.org/price)

eww_ioc_container to override the IoC container if you want to use different classes in the application (including the API to grab weather data)

Usage of eww_template filter

Add a “views” directory and file named “custom-eww.php” to your template directory. The “custom-eww.php” file will be your custom template for this example.

Example of using a custom template from within your theme PHP 5.3+ which allows closures

    <?php

        add_filter( 'eww_template', function ( $template ){
            $template_dir = get_template_directory();
            return $template_dir . '/views/custom-eww.php';
        } );
        ?>

Grunt

This plugin takes advantage of Grunt for validating JavaScript, SASS compilation and minification. To take advantage of Grunt you have to have both npm and Grunt installed. Visit the respective sites for the applications and make sure they are installed. Once installed, if you want to edit/fork this plugin, it will be helpful to be familiar with these two tools.


FAQ
ChangeLog