Show the current weather in your WordPress sidebar or inline with your posts and pages.
The Dark Sky API provides up to 1,000 free requests per day for a registered developer. Greater than 1,000 calls are charged at a rate of $0.0001 per call. This plugin makes use of the WordPress Object Cache to reduce the number of calls against the API to one per hour (per location) when combined with one of the several persistent cache plugins available.
- Download the [zip file] or clone this repository into your
wp-content/plugins/
folder. - Navigate the "Plugins" section in the WordPress admin
- Click "Activate" next to the plugin name
- A message will appear saying the plugin needs an API key
- Click the "Settings" link (either in the alert or in the side navigation) to provide an API key
This plugin offers two approaches for use:
Add the "Weather" widget to your sidebar for themes that support them. If you are working with a custom theme, see the documentation on adding a Widget sidebar.
When added, you will be prompted to provide a latitude and longitude for your location. If you need to find the values for this, use can use an online tool.
The [darksky]
short code allows you to place the current weather conditions for a location in to a page or post.
An example for Nashville, Tennessee:
[darksky latitude="36.166667" longitude="-86.783333"]
A default option, which will use either Nashville, or the defaults specified in the Settings > Dark Sky Weather options page.
[darksky]
- Install SASS
- Run
make compile_css
from the root of the plugin to compile changes. - Run
make watch_css
to watch for changes and auto-compile.
- API powered by Dark Sky
- Icons created by the National Weather Service