开发者 | davidmatthew |
---|---|
更新时间 | 2024年3月21日 06:48 |
PHP版本: | 7.0 及以上 |
WordPress版本: | 6.1 |
版权: | GPL-3 |
版权网址: | 版权信息 |
[ventus]
and it will work (or the old shortcode [weather-map]
which will continue to work), but you will most likely want to customise the remaining attributes yourself.
An example of a fully filled-out shortcode would be:
[ventus width="100%" height="350px" radius="20px" loading="lazy" lat="53.199" lon="-7.603" zoom="4" layer="wind" scale="C" units="knots" pressure="true" marker="true" forecast="true" time="12"]
.
The attributes can be set as follows:
width
attribute accepts any valid CSS property for width.height
attribute accepts any valid CSS property for height.radius
attribute accepts any valid CSS property for border-radius.loading
attribute accepts either lazy or eager. The default is lazy loading.lat
attribute must contain a string of digits to three decimal places, in the range of -90 to +90 (e.g. "53.199").lon
attribute must also contain a string of digits to three decimal places, in the range of -180 to +180 (e.g. "-120.894").zoom
attribute must contain a number between 3 and 11 (inclusive).layer
attribute accepts the following values: clouds, cosc (CO concentration), radar, rain, snowcover, sst (sea temperature), temp (standard temperature), waves and wind.scale
attribute accepts either "C" or "F", defining Celsius and Fahrenheit respectively.units
attribute accepts the following values: bft (beaufort), km/h (kilometers per hour), kt (knots), m/s (meters per second) and mph (miles per hour).pressure
attribute can be set to true to display pressure isolines, otherwise the isolines will remain hidden.marker
attribute can also be set to true, otherwise it will remain hidden.forecast
attribute can be set to true to display the spot forecast, otherwise it will remain hidden.time
attribute accepts the following values: now (the default), 12 (12 hours from now) and 24 (24 hours from now).This can happen sometimes with the shortcode if you wrap the longitude or latitude attributes in the wrong kind of quote marks.
Mark sure you are using " "
rather than ” ”
, e.g.
Correct: lat="44.096"
Incorrect: lat=”44.096”
= How do I set the latitude and longitude?
The easiest (and recommended) way to do this is to go straight to windy.com. Once there, take note of the URL. It will contain the latitude and longitude in its parameters, and if you zoom in, it will also contain the zoom level. For example, the sample parameters I use as defaults are: latitude 53.199, longitude -7.603, and a zoom level of 5. These would show in the URL in the following format: windy.com/?53.199,-7.603,5.
If you'd prefer to do this, that's great - no problem! However, this plugin was created to make the iframe that windy.com kindly provide even more useful. To that end, it offers the following advantages:
[ventus]
(the old shortcode [weather-map]
has been maintained for backwards-compatibility).