Weather Forecast Widget

plugin banner

This plugin WEATHER FORECAST WIDGET shows a widget with current weather and 3-day forecast weather data, which will be received from the Open Weather …

Author:Dominik Luger (profile at wordpress.org)
WordPress version required:3.0.1
WordPress version tested:5.8.2
Plugin version:1.1.2
Added to WordPress repository:10-04-2021
Last updated:28-11-2021
Rating, %:0
Rated by:0
Plugin URI:https://www.bergtourentipp-tirol.at
Total downloads:593
Active installs:60+
plugin download
Click to start download

GENERAL

The weather data for this widget will be retrieved from the OpenWeatherMap API with your own API key.

INPUT DATA

You can show the weather for a CITY (input data: city name) or for specific COORDINATES (input data: latitude & longitude coordinates) in the widget.

PLACEMENT/SHORTCODE

The weather widget can be implemented in a page, a post or into the widget area with the help of the shortcode [weather_forecast_widget]. Furthermore you´ll be able to pass different attributes to each shortcode to override your settings for this widget placement (e.g. manage widget title with an shortcode attribute).

TEMPLATES

Currently you can choose 3 templates for the widget.
* Template 1
* Current day´s weather with a weather forecast for the next 3 days
* Template 2
* Template 2 uses Bootstrap!
* Current day´s weather with an hourly weather forecast and a weather forecast for the next 3 days
* Template 3
* Template 3 uses Bootstrap!
* Weather for the current day and for the next 7 days, each with an hourly weather forecast and a weather forecast for the next 3 days

BACKGROUND IMAGE

For this widget, you´ll be able to choose your own background image. Either you set a static background image in the widget settings or you choose the dynamic variant (thumbnail of the page/post, where the shortcode is placed) will be used as a background image.

WEATHER DATA

In addition to the daily weather forecast, an hourly weather forecast can also be displayed in the widget. Both the daily and hourly weather forecast can be collapsed.

ALERTS

The weather widget also shows weather alerts. These alerts are dismissable.

WEATHER ICONS

In the widget you´ll find awesome and beautiful weather icons. In the plugins settings page you can choose which weather icons you want to use for the widget.
* Animated Icons Filled
* Animated Icons Not Filled
* Static Icons

LAZY LOADING

You have the possibility to load the widget with lazy loading (ajax) to load the data only when necessary.

CACHING

Nowadays caching is an important topic. This weather forecast widget makes it possible to cache the received weather data for the next visitor, who will visit your website page/post next time. You´ll be able to set your desired caching time in the settings (caching time possible up to 1 hour => this should ensure that the weather data in the widget is as current as possible). With this caching possibility you´ll also save API calls.

SHORTCODE EXAMPLES

  • Retrieve weather data for a city
    • [weather_forecast_widget city=”Kufstein”]
  • Retrieve weather data for a city and show city name as title text
    • [weather_forecast_widget city=”Kufstein” title_cityname=”X”]
  • Retrieve weather data for specific coordinates
    • [weather_forecast_widget lat=”47.5824″ lon=”12.1627″]
  • Retrieve weather data for specific coordinates and show “Weather for Weather Widget” as title text
    • [weather_forecast_widget lat=”47.5824″ lon=”12.1627″ title_overwrite=”Weather for Weather Widget”]
  • Retrieve weather data with lazy loading and template 3 for specific coordinates and expand the hourly and daily forecast initially
    • [weather_forecast_widget lazy_loading=”X” template=”3″ hourly_forecast=”show” daily_forecast=”show” lat=”47.5824″ lon=”12.1627″]

SETTINGS

  • Input box for your OPEN WEATHER MAP API key (the api key will be tested for validity while saving!)
  • Dropdown box to choose if caching of the weather data is necessary and if yes, which CACHE TIME should be used.
  • Media uploader/selector to choose a BACKGROUND IMAGE for the widget (optional – otherwise the page/post thumbnail will be used)
  • Radiobuttons to select the WIDGET TITLE TEXT, which will be displayed in the widget. This setting will be used as a default if nothing else will be passed in the shortcode. If you´ll pass title_cityname or title_overwrite as a shortcode attribute, this attribute will be processed in the widget output.
  • Dropdown to choose the POST META FIELD for the title text, if you selected the readio button “Post Meta Field (choose one of the dropdown below)
  • Choose, which WEATHER VALUES should be shown in the widget
  • Choose, which UNITS should be used to display the weather values
  • Choose, which WEATHER ICONS should be used for the widget

TRANSLATIONS

  • German – adminbergtourentipptirol

Credits


Screenshots
ChangeLog