Skip to content

Instantly share code, notes, and snippets.

@diegolucero
Created November 22, 2017 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diegolucero/0d2d71f9392b660402d0bf8e4ad2b6d8 to your computer and use it in GitHub Desktop.
Save diegolucero/0d2d71f9392b660402d0bf8e4ad2b6d8 to your computer and use it in GitHub Desktop.
Add this to your functions.php child theme to add the shortcode [year] into your wordpress install. Great for footers that require an updated copyright year.
// Updates year in footer
// =============================================================================
function year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'year_shortcode');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment