function year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'year_shortcode');или:
function year_shortcode() {
$fromYear = 2017;
$thisYear = (int)date('Y');
return $fromYear . (($fromYear != $thisYear) ? '-' . $thisYear : '');
} add_shortcode('year', 'year_shortcode');Можно использовать для вывода копирайта через шорткод. Использование: [year]