Like the blog? Get the book »

Dynamic Copyright in your WordPress Footer

Dynamic Copyright in your WordPress Footer

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 (most likely footer.php):

   © <?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

    ooh nice tip! :)

  2. Eric Lightbody

    nice tip, thanks!

  3. Very simple, very nice. Thank you.

Comments are closed for this post. Contact us with any critical information.
© 2009–2024 Digging Into WordPress Powered by WordPress Monzilla Media shapeSpace