Created
January 7, 2024 12:41
-
-
Save hmbashar/576455f1470b7d92576092834887d738 to your computer and use it in GitHub Desktop.
simple you can dynamic your current year in the footer copyright area
This file contains hidden or 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
<?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