Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/lukasbesch/shortcode-year-or-years/archive/refs/heads/master.zipOn Packagist as lukasbesch/shortcode-year-or-years:
composer require lukasbesch/shortcode-year-or-yearsNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Provides a WordPress shortcode to display the current year, and optionally a start year.
Commonly used for copyright notices.
Installation
composer require lukasbesch/shortcode-year-or-years
Alternatively download the latest release from GitHub and install it into the plugins directory.
Usage
Show current year
[year_or_years]
// 2026
Show current year and a start year
[year_or_years from="2019"]
// 2019–2026
The start year will only be displayed if it is lower than the current year:
[year_or_years from="2026"]
// 2026
Optionally specify a custom separator:
[year_or_years from="1984" separator=" until "]
// 1984 until 2026