Shortcodes
Every shortcode prints the weather the plugin last fetched, so a page never waits for a weather service. On a page served from a cache, the browser brings every widget up to date. Several shortcodes, and several copies of one, can share a page.
On every widget
Every shortcode that draws a widget also takes:
| Attribute | Default | What it does |
|---|---|---|
theme | the site's look | A look by its id: atlantico, laurissilva, por-do-sol, noite, levada, postal, azulejo, or the id of a look you saved. See Looks and the theme editor. |
icons | the look's | meteo-fill, meteo-line, amcharts, lucide or tinted. See Icon sets. |
mode | the look's | auto, light or dark |
sky | the look's | animated or off. See Weather backgrounds. |
Example: [madeira_weather_cards theme="noite" icons="meteo-line" sky="animated"]
Location attributes take a town's name or its slug: Santana, santana and SANTANA are the same town, and so are São Vicente and sao-vicente. The Shortcodes tab lists the slugs of your towns.
True and false attributes take true or false.
Weather cards
[madeira_weather_cards]: a card per town with its icon, temperature, condition, "feels like", chance of rain, wind and activity tip. layout="hero" draws one big card per town instead, with the day's range, rain, wind, UV and the sea. The tip on each card follows IPMA's warnings, daylight and the weather before it shows your own tip for the temperature, and the badge goes only where the weather is genuinely good: see What the cards recommend. IPMA's warnings for the towns shown sit above the cards, and the time of the data under them.
| Attribute | Default | What it does |
|---|---|---|
layout | grid | grid, or hero: one big card per town |
columns | auto | 1 to 6 columns, or auto to fit the space. On narrow screens the cards stack. |
locations | all | Towns to show, separated by commas: Funchal,Machico,Santana |
show_recommendations | true | The activity tip of the town's temperature level |
show_map_button | true | The button set on the temperature level, if any |
show_best_badge | true | The best-weather badge |
show_feels_like | true | "Feels like" temperature |
show_humidity | false | Humidity in % |
show_wind | shown | false hides the wind |
show_uv | false | UV index with its level (Low to Extreme) |
show_wind_direction | false | Wind direction (N, NE...) with an arrow pointing where the wind blows |
show_precipitation | shown | false hides the chance of rain |
show_wave_height | false | Wave height off Funchal, in metres |
show_sea_temp | false | Sea temperature off Funchal |
show_warnings | Settings | IPMA's warnings above the cards, once per page: the first widget that shows them has them, the others leave them out. false never, always on this widget even when another has them (default: Settings, Display, Weather warnings) |
show_time | true | The line under the cards: now, the forecast hour, the stations' time and the last update |
ssr | true | false prints a placeholder and leaves the weather to the browser |
class | Extra CSS classes |
Example: [madeira_weather_cards columns="3" locations="Funchal,Santana,Porto Moniz" show_wind="true" show_precipitation="true"]
The first grid on a page gives each card an anchor named after the town, so a link to #funchal scrolls to Funchal's card.
Map
[madeira_weather_map]: the island coloured by temperature, rain or wind, with a pin per town and a tooltip. Choosing a region scrolls to its card, or opens the link set for it on the Maps tab. See The map.
| Attribute | Default | What it does |
|---|---|---|
map | madeira-island | madeira-island or porto-santo |
width | 100% | A CSS length: 100%, 600px, 40rem, auto |
max_width | 980px | A CSS length, or none |
layer | temperature | temperature, rain or wind: the layer it opens on |
show_labels | true | Temperatures and names on the map |
show_city_names | true | Names under the temperatures |
show_legend | true | The temperature levels under the map |
clickable | true | Regions can be chosen with the mouse or the keyboard |
show_warnings | Settings | IPMA's warnings under the map's heading, once per page; false or always as on the cards |
class | Extra CSS classes |
Temperature legend
[madeira_weather_legend]: the temperature levels and their colours, with today's date and the last update under them. Attributes: show_updated (true; false leaves the date out), title (your own heading) and class. The thresholds follow the site's unit.
Forecast
[madeira_weather_forecast]: one town, day by day, with the icon, high and low, and the chance of rain. Up to 5 days with IPMA, 7 with Open-Meteo.
| Attribute | Default | What it does |
|---|---|---|
location | Funchal | The town |
days | 7 | 1 to 7 (IPMA has 5) |
layout | horizontal | horizontal (the days side by side, with the highs and lows drawn as a band), vertical (a line per day, with a bar from low to high) or compact (side by side, no band) |
show_precipitation | true | Chance of rain |
show_wind | false | Highest wind of the day in km/h |
ssr | true | false prints a placeholder and leaves the forecast to the browser |
class | Extra CSS classes |
A location that is not one of your towns shows nothing to visitors, and a short note to logged-in editors.
Sunrise and sunset
[madeira_sun_times]: today's sunrise and sunset in Funchal, in the site's time zone.
| Attribute | Default | What it does |
|---|---|---|
layout | vertical | arc: the sun's path across the sky, where it is now, the length of the day, golden hour, and a note when the clocks change within the week. vertical or horizontal: sunrise and sunset as two cards. compact: the arc alone. |
location | Funchal | A town, for its own times (with arc) |
show_icons | true | The sunrise and sunset icons |
class | Extra CSS classes |
Date and last update
[madeira_weather_date]: today's date in Madeira and how long ago the weather was measured ("Updated 12 minutes ago").
| Attribute | Default | What it does |
|---|---|---|
show_date | true | The date |
show_updated | true | The time since the last measurement |
date_format | D, j M Y | A PHP date format |
class | Extra CSS classes |
Comparison
[madeira_weather_compare]: towns side by side, as a table or as bars, with the best value of each row starred, or two towns face to face with layout="duel".
| Attribute | Default | What it does |
|---|---|---|
locations | all | Towns, separated by commas |
metrics | all | Any of temperature, temp_feels_like, humidity, uv, wind, precipitation, conditions |
layout | table | table, bars, or duel: the first two towns face to face, row by row, and which is better today |
highlight_best | true | Star the best value of each row: warmest, driest, calmest, lowest UV |
limit | 5 | 1 to 11 towns |
class | Extra CSS classes |
The Madeira widgets
| Shortcode | Shows | Page |
|---|---|---|
[madeira_weather_sea] | The sea on the south and north coasts, for boat trips | Sea conditions |
[madeira_weather_warnings] | IPMA's weather warnings, as a banner | Weather warnings |
[madeira_weather_golden_hour] | Golden and blue hour, and your viewpoints | Golden hour |
[madeira_weather_levadas] | The best levada walks today | Best levada walk today |
[madeira_weather_viewpoints] | The viewpoints, each with its sunrise or sunset and a verdict | Viewpoints |
[madeira_weather_best_today] | The best walk, beach and viewpoint right now | Best today in Madeira |
[madeira_weather_tip] | The day in a few sentences | Today in Madeira |
[madeira_weather_clouds] | A sea of clouds below the summit at sunrise (with an Open-Meteo key) | Above the clouds |
Updated
Since 3.4 the four lists of places (levada walks, trails, viewpoints and beaches) share one set of options: show only what is good, rank, sort, narrow by region or distance, pages and filters for visitors. See List options.
Since 3.3 the forecast, the comparison, Today in Madeira, the warnings and Above the clouds end with "Updated 20:41", when their data was fetched. show_updated="false" on a widget leaves it out. The cards and the map have their own line (now, the forecast hour, the stations' time and the last update), the walks, trails, beaches and airport say when their source reported.
Credit
[madeira_weather_credit]: the data source's credit line on its own ("Data: IPMA"), for layouts built from single values or the loop.
Single values
One value for your own layout. Each takes location (default: your first town) and class, and is brought up to date by the browser on a cached page.
| Shortcode | Shows | Attributes |
|---|---|---|
[mw_temperature] | 22°C | unit="false" shows 22° |
[mw_feels_like] | 24°C | unit |
[mw_condition] | Partly cloudy | format="key" gives partly_cloudy |
[mw_icon] | the icon | size in pixels (default 48) |
[mw_humidity] | 65% | unit |
[mw_wind] | 12 km/h | unit |
[mw_wind_direction] | NW with an arrow | format="degrees", show_arrow="false" |
[mw_precipitation] | 20% | unit |
[mw_uv_index] | 6 (High) | show_level="false" |
[mw_location_name] | Funchal | |
[mw_sea_temp] | 21°C off Funchal | unit (no location) |
[mw_wave_height] | 1.2m off Funchal | unit (no location) |
[mw_sunrise], [mw_sunset] | 07:15 | format: a PHP time format |
Loop
[mw_loop]{template}[/mw_loop] repeats your template for each town. Attributes: locations, icon_size (pixels, default 48), class (wraps the result in a div), item_class (available as {item_class}).
Placeholders: {location_name}, {location_slug}, {temperature}, {temperature_raw}, {feels_like}, {feels_like_raw}, {condition}, {condition_key}, {icon}, {humidity}, {humidity_raw}, {wind}, {wind_raw}, {wind_direction}, {wind_direction_deg}, {wind_arrow}, {precipitation}, {precipitation_raw}, {uv_index}, {uv_index_raw}, {uv_level}, {sea_temp}, {wave_height}, {sunrise}, {sunset}, {item_class}.
The template may use div, span, p, h1 to h4, small, strong, em and br. A placeholder that does not exist stops the loop with an HTML comment naming it.
[mw_loop class="my-grid" icon_size="64"]
<div class="my-card {item_class}">
<h3>{location_name}</h3>
{icon}
<p>{temperature}, {condition}</p>
</div>
[/mw_loop]
[madeira_weather_credit]
The loop is printed with the page; on a cached page it shows the weather of when the page was cached.