Skip to content

Instantly share code, notes, and snippets.

@hmbashar
Created January 7, 2024 12:41
Show Gist options
  • Save hmbashar/576455f1470b7d92576092834887d738 to your computer and use it in GitHub Desktop.
Save hmbashar/576455f1470b7d92576092834887d738 to your computer and use it in GitHub Desktop.
simple you can dynamic your current year in the footer copyright area
<?php
#Method 01
//Shortcode for current year
function cb_current_year() {
$year = date('Y');
return $year;
}
add_shortcode('cb_current_year', 'cb_current_year');
?>
#Method 02
<script>document.write(new Date().getFullYear())</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment