Created
October 18, 2019 04:04
-
-
Save Balachandark/9b9eda63387e94e3b1c7b8c8377bb0d2 to your computer and use it in GitHub Desktop.
Creating a Shortcode for current 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
//Display current year | |
function year_shortcode () { | |
$year = date_i18n('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