Wish you never had to update a footer widget to change the copyright year ever again? You need to implement a dynamic copyright year into your site.
Here are a couple ways to automate this needless yearly task.
If you have control over the theme, here is the PHP code that will automatically spit out the current year.
1 | © <?php echo date('Y');?> |
Or, if you can’t or don’t want to touch the footer.php file, here is a javascript alternative. You should even be able to use this in a custom HTML or text widget.
1 | © <script>document.write(new Date().getFullYear());</script> |
Leave a Reply