Custom copyright in footer

If you find this tweak helpful:


Tweaking Elegant Themes involves creating a child theme and editing PHP and CSS files within a text editor. If you have never done this you may want to read our guide on creating a child theme. All tweaks are written with the assumption that you have a default installation of your theme.  Any tweaks or changes you may have previously made to your theme could affect the outcome of the tweaks on this site. All tweaks should be tested before applying to a live site. 

20% Discount!!!
Divi WordPress Theme

Chameleon comes with the standard information in the footer section of the theme. To remove references to Elegant Themes and WordPress and add your own information, this simple tweak will do the trick and adds a nifty copyright year trick.


Locate the footer.php file in /themes/chameleon/

Save an exact copy of this file to /themes/chameleon-child/

Locate the following code near line 7:

<p id="copyright"><?php esc_html_e('Designed by ','Chameleon'); ?> <a href="" title="Premium WordPress Themes">Elegant WordPress Themes</a> | <?php esc_html_e('Powered by ','Chameleon'); ?> <a href="">WordPress</a></p>

Change it to this:

<p id="copyright">&copy; 
ini_set('date.timezone', 'America/New_York');
$start_year = 2013;
$this_year = date('Y');
if ($start_year == $this_year) {
echo $start_year;
else {
echo "{$start_year}-{$this_year}";

Replace ExampleSite in the last line with the name of your website, llc, or other business name. If you prefer not to have the Copyright symbol, you can remove &copy from the first line.  Everything in between is a PHP script that will display a date range so users know how long the website has been active. I changed the $start_year to 2008 in my screenshot to show you what happens when the current year is different than the start year. Once this code is added to your footer, you can set it and forget. It will auto-update every year.

Post a Reply

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