by Chris Coyier & Jeff Starr

Dynamic Copyright in your WordPress Footer

Posted by Updated on

Many footers on websites contain text like "© 2009 Your Website". A good measure, surely. We can use some classic PHP and a built-in WordPress function to make this bit of text dynamic so that it will never need to be tampered with manually again. Here is the code to add to your theme template file (e.g., footer.php):

   &copy; <?php echo date("Y"); echo " "; echo bloginfo('name'); ?>

The year will always be the current year, based on your server's set time. The text will come directly from the Blog Title setting in Settings > General.

3 Responses

  1. Liam Goodacre June 16, 2009

    ooh nice tip! :)

  2. Eric Lightbody June 18, 2009

    nice tip, thanks!

  3. Rukbat July 4, 2009

    Very simple, very nice. Thank you.

Comments are closed. Contact us with any critical information. Thank you!

Code is poetry