Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
You can’t perform that action at this time.