Interactive · Gutenberg

Weather Widget block for WordPress

Live weather display with current conditions, temperature, humidity, wind speed and a 5-day forecast. Powered by OpenWeatherMap free API.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Live weather display with current conditions, temperature, humidity, wind speed and a 5-day forecast. Powered by OpenWeatherMap free API.

Inspector panels on this block: API & Location, Display Options, Layout, Background. Those titles come from index.js, not from a shared template.

Behavior controls: “OpenWeatherMap API Key” (Free key from openweathermap.org); “Default City” (e.g. London, New York, Tokyo); “Units” options: Celsius (°C), Fahrenheit (°F), Kelvin (K); “Language” options: English, Russian, German, French, Spanish.

Where to find it

Gutenberg inserter → Interactive → search “Weather Widget” (block name `blockenberg/weather-widget` in block.json). Style it in the sidebar after insert.

How to use Weather Widget block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Weather Widget”, insert it. Category: Interactive.
  3. Configure inspector controls that exist on this block. Open API & Location. Set “OpenWeatherMap API Key”, “Default City”, “Auto-detect visitor location (Geolocation)”, “Units”.
  4. Check the published page. The view script reads HTML data attributes: data-opts, data-ww-refresh. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
OpenWeatherMap API KeyText field in the inspector. Free key from openweathermap.org. Saved as `apiKey`.
Default CityText field in the inspector. e.g. London, New York, Tokyo. block.json default: London. Saved as `city`.
Auto-detect visitor location (Geolocation)On/off toggle in the inspector. Off by default. Saved as `autoLocation`.
UnitsSelect control; the chosen value is saved on the block. Options: Celsius (°C); Fahrenheit (°F); Kelvin (K). block.json default: metric. Saved as `units`.
LanguageSelect control; the chosen value is saved on the block. Options: English; Russian; German; French; Spanish; Japanese. block.json default: en. Saved as `lang`.
Auto-refresh interval (minutes)Numeric range control in the inspector. 0 = no refresh. Range 0–60. block.json default: 10. Saved as `refreshInterval`.
Show feels-like temperatureOn/off toggle in the inspector. On by default. Saved as `showFeelsLike`.
Show humidityOn/off toggle in the inspector. On by default. Saved as `showHumidity`.
Show wind speedOn/off toggle in the inspector. On by default. Saved as `showWind`.
Show pressureOn/off toggle in the inspector. Off by default. Saved as `showPressure`.
Show visibilityOn/off toggle in the inspector. Off by default. Saved as `showVisibility`.
Show animated weather iconOn/off toggle in the inspector. On by default. Saved as `showAnimatedIcon`.
Show 5-day forecastOn/off toggle in the inspector. On by default. Saved as `showForecast`.
Forecast daysNumeric range control in the inspector. Range 2–5. block.json default: 5. Saved as `forecastDays`.
LayoutSelect control; the chosen value is saved on the block. Options: Card (centered); Wide (full-width); Minimal (compact). block.json default: card. Saved as `layout`.
Max width (px)Numeric range control in the inspector. Range 280–800. block.json default: 480. Saved as `maxWidth`.
Padding (px)Numeric range control in the inspector. Range 8–64. block.json default: 32. Saved as `padding`.
Outer radius (px)Numeric range control in the inspector. Range 0–48. block.json default: 24. Saved as `borderRadius`.
Card radius (px)Numeric range control in the inspector. Range 0–32. block.json default: 16. Saved as `cardRadius`.
Background styleSelect control; the chosen value is saved on the block. Options: Gradient (auto by weather); Custom color; Transparent. block.json default: gradient. Saved as `backgroundStyle`.
Text colorColor control in the inspector. block.json default: #ffffff. Saved as `textColor`.
Accent colorColor control in the inspector. block.json default: #60a5fa. Saved as `accentColor`.
Card backgroundColor control in the inspector. block.json default: rgba(255,255,255,0.12). Saved as `cardBg`.
Forecast day backgroundColor control in the inspector. block.json default: rgba(255,255,255,0.08). Saved as `forecastBg`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Weather Widget block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Weather Widget”. It sits under Interactive. After insert, open API & Location and set “OpenWeatherMap API Key”, “Default City”, “Auto-detect visitor location (Geolocation)”, “Units”.

What makes Weather Widget different from other Blockenberg blocks?

Live weather display with current conditions, temperature, humidity, wind speed and a 5-day forecast. Powered by OpenWeatherMap free API. Inspector labels on this block include “OpenWeatherMap API Key”, “Default City”, “Auto-detect visitor location (Geolocation)”, “Units”.

Is the Weather Widget Gutenberg block free?

Yes. Weather Widget ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Weather Widget to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: API & Location, Display Options, Layout, Background).

Related interactive blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Weather Widget from the Gutenberg inserter.

Get Blockenberg