Easy Weather Widget

Easy Weather Widget Install Statistics

0
100%
Today: 0 Yesterday: 0 All-time: 18,537 downloads
Easy Weather Widget Icon

Try plugin: Easy Weather Widget

We'll create fresh WordPress site with Easy Weather Widget installed. You have 20 minutes to test the plugin after that site we'll be deleted.

Takes ~10 seconds to install.

About Easy Weather Widget

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.

5


0


0


0


1

updated: 6 years ago
since: 12 years ago

Description

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.