It is the time of the year when you evaluate how your last year went as far as blogging is concerned. Its also the time to update the blog to reflect the new year. One of the first thing the needs to be updated is the copyright year in the footer of the blog.
While browsing the web today, I found that most of the sites’ footers aren’t updated yet. May be because they have hard coded the year in the footer, and they just forgot to change it in the new year.
The best way to change the copyright year in the footer is to use a simple WordPress hack so that it updates automatically every year. The simplest way to set the automatically updating year is to replace the copyright statement in footer.php file of your theme, with this code,
This will display the current year automatically. Thus, the code above will display,
Now that you know that the code, <?php echo date('Y'); ?>
will output the year, you can use it in any way you like.
• The following code,
will display,
• Similarly the code snippet below,
will display,
Important Note: The code to display the current year takes the year from the server on which the site is hosted. So, if your site is hosted on a server which is located in another country, then it may take some time (12 hours maximum) before the correct year is displayed.