Created
November 22, 2017 17:00
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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