Effortlessly Keep Your Copyright Up-to-Date: Automated Yearly Updates
Changing the copyright date can be an annoying task and is easy to forget every year. Of course, you don't want the visitors to think that your website is outdated. That's why I've made a short bit of code to place on the website with which you can place "[currentYear]" anywhere, and it will change to the year that it currently is.
Explanation and available changes
In the snippet, you can see that we only check in the footer in this line:
If you want the code to change the "[currentYear]" on the whole page, you can change 'footer' to '*'. We only check for the footer because that makes it quicker, and most of the time that's where the copyright is at. For this to work, the container in which you want the current year to be needs to have the tag-name "footer".
We also use "break" at the end of the for loop, again to make it quicker. This basically stops the code when one "[currentYear]" is changed. If you have multiple occurrences you want to change, you can just remove this.