Adding a Copyright Range at the Bottom of Your Website Using PHP PHP Snippet

I wanted to implement a simple copyright message in the footer of this site, but the theme I’m using doesn’t allow that (free version of the theme lacks the ability to edit the text.) So, while that’s a bummer, I figured I would share the code that I wrote for it that would allow you to:

1) Show the starting year for your website
2) Show the current year without you having to change it each year (it automatically updates itself)

This can be used on any site regardless of whether it’s a blog. It will need to be bracketed within php tags if it’s not being integrated into pre-existing php code. Here’s what it looks like in action elsewhere on my site:

A screenshot of this code at work!

The code follows:

$startyear = "2007"; // The starting year
$currentyear = date("Y"); // The current year
$entity = "Beyond the Winter: The Blog"; // Name of site or person that owns the copyright

// You can change the text below to output what you want it to, just plug in the variables set above as you see fit

echo "Copyright (c) $startyear - $currentyear";
echo " $entity";

Real simple stuff. Hopefully, someone finds it useful.

If you found this post useful, leave a comment below!

Leave a Reply

Your email address will not be published. Required fields are marked *