How to Add a Dynamic Copyright to Your Web Site Footer

In preparation for the new year, this is a simple but useful PHP snippet for keeping your copyright notice up to date on your blog or Web site.

<?php
echo 'Copyright &copy; 2006 &ndash; ' . date("Y");
?>

That will output Copyright © 2006 – 2007, with the “2007″ dynamically updating to the current year.

The HTML entity &ndash; just means a dash. You could also do just:

Copyright &copy; <?php echo date("Y"); ?>

…which would output Copyright © 2007 (with the date always being the current year).

It works on WordPress blogs also — just insert the code snippet in footer.php.

Popularity: 8% [?]

Share This:
  • Sphinn
  • Digg
  • del.icio.us
  • Reddit
  • StumbleUpon
  • Twitter
  • Facebook
  • Google Bookmarks
  • Mixx
  • Tumblr
  • FriendFeed
  • LinkedIn

3 Comments

  1. Posted December 9, 2007 at 8:10 pm | Permalink

    I recommend that a date-last-modified bit be added for those of us pour souls who do web research a lot. Just remember to put this code on the actual content page, not include files that exist on every page, etc.

  2. Posted December 9, 2007 at 8:11 pm | Permalink

    Comment field swallowed my code… here ya go with slight mods:

    <?php
     
    $last_modified = filemtime("thisfile.php");
     
    print "Last modified " . date("l, dS F, Y @ h:ia", $last_modified);
     
    ?>
  3. Posted November 18, 2009 at 4:50 am | Permalink

    Resources for all the colleges – higher education and employment in Canada and in the world. Info about undergraduate, career resources, jobs by location, information for students.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*