WP Manifestindependent plugin directory
manifest / utilities / cwp_weather

Custom Weather Plugin

A custom WordPress plugin that adds an admin settings page to configure a city and API key, fetches live weather data from the OpenWeatherMap public API, and displays the result on the front end via a shortcode.

by Patrick Pucan · github.com/pjpucan/cwp_weather · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/pjpucan/cwp_weather/archive/refs/heads/master.zip

Readme

Custom Weather Plugin

A custom WordPress plugin that adds an admin settings page to configure a city and API key, fetches live weather data from the OpenWeatherMap public API, and displays the result on the front end via a shortcode.

Features

  • Admin settings page under Settings → Weather Plugin to save your API key, city, temperature unit, and cache duration.
  • Public API fetch from OpenWeatherMap using WordPress-native wp_remote_get(), with responses cached via Transients to minimise API calls.
  • Front-end output through the [weather_display] shortcode, which renders a clean, accessible weather card on any page or post.

Requirements

Installation

  1. Upload the custom-weather-plugin folder to /wp-content/plugins/.
  2. Activate via Plugins → Installed Plugins.
  3. Go to Settings → Weather Plugin and enter:
    • Your free OpenWeatherMap API key (register at https://openweathermap.org/api)
    • The city name (e.g. Manila,PH)
    • Preferred temperature unit
    • Cache duration in minutes
  4. Add [weather_display] to any page or post.

Shortcode Usage

Default (uses the city saved in settings):

[weather_display]

Override city inline:

[weather_display city="Manila,PH"]

Override both city and units:

[weather_display city="Sydney,AU" units="imperial"]

Read the full README on GitHub →