WordPress: Auto Updating Copyright Year

I use this snippet in the footer of my WordPress sites. The year automatically updates. So you never have to worry about changing it every year.

// Displays "© 2019"

© <?= date('Y') ?>

// Displays "© 2013-2019 MyCompanyName"

<?php call_user_func(function($y){$c=date('Y');echo $y.(($y!=$c)?'-'.$c:'');}, 2013); ?> MyCompanyName.

Leave a comment

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