Skip to content

Instantly share code, notes, and snippets.

Embed
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.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.