Most WordPress themes have a copyright notice in the footer like the one we use: © Copyright 2003-2009 Poiesis Web Development. The copyright notice is fine for the first year, however, it needs to be updated every January, or your blog begins to look old and unprofessional. Maybe you’re growing weary of having to open the footer.php file to manually change the copyright year every January. Well, since WordPress is based on PHP, there’s a simple solution called the PHP date() function.
The date() function
The PHP date() function returns the current timestamp as a string that can be formatted to displayed particular elements of the timestamp, such as the day, the time, the year, etc. In this post we’re interested in the year and there are two PHP format for year: 'Y', which represents the full year, as in 2009, and 'y', which represents the last two digits of the year, as in 09. The format that we use in the four digit format ('Y').
Continue reading “Automatically Changing the Copyright Year in Your Footer” »
