PHP - Copyright year - Shortcode

Generated a shortcode you can use on your website to place the current year in the Copyright.

<?php
function copyrightyear_shortcode() {
$year = date_i18n ('Y');
return $year;
}
add_shortcode( 'copyrightyear', 'copyrightyear_shortcode' );

Last updated

Was this helpful?