Wordpress Tips  

How to automatically update my WordPress footer Copyright Date using PHP?

The New Year is coming, There are always some simple task that we missed to do. Some time simple things can be missed for years. One good example is your site copyright date.I noticed while now is 2010 but my site footer date still displayed 2009 and this may remain for 2011 or even 2012. You know not only HeCode. you also can code! let see how to fix this forever.

by using following simple PHP code, your Copyright date will change every year. Add this code once to your WordPress footer and enjoy rest of your life:)

&#169; Copyright <?php
$from = 2009;
$now = date('Y');
if ($from == $now)
echo $now;
else
echo "$from - $now"; 
?> YourSite.com

Make sure to edit $from and set it to the year that your site was launched. Final year is automatically calculated using PHP’s date() function. but it you just created your site. It will display one date.

Do you want to see an example? Then have a look to my site footer. You will love it!

Do you need farther help on this topic? Contact me
Do you need Professional coder? Hire me
Looking for different WordPress plugin? Try Wishlist member


Andy is one of core WordPress WishList Member Developer. He is in love with WordPress and fun of turning new ideas to WordPress plugin or theme.

Add your comment


  1. ispacecrusader
    January 7, 2011
    1:33 pm

    Thanks for the tip, works like a charm!

RSS feed for comments on this post. TrackBack URL

Add your comment.





( DoFollow )

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Home | Themes | Plugins | Download | Forum | Freelance | Resume | Projects | Service | Contact | About
© Copyright 2009 - 2012 Hecode.com