Skip to content

Provides a shortcode to display the current year, and optionally a start year. Commonly used for copyright notices.

Notifications You must be signed in to change notification settings

lukasbesch/shortcode-year-or-years

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shortcode: Year or years

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]
// 2024

Show current year and a start year

[year_or_years from="2019"]
// 2019–2024

The start year will only be displayed if it is lower than the current year:

[year_or_years from="2024"]
// 2024

Optionally specify a custom separator:

[year_or_years from="1984" separator=" until "]
// 1984 until 2024

About

Provides a shortcode to display the current year, and optionally a start year. Commonly used for copyright notices.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages