On your WordPress website you may want to make a shortcode that displays the year. You can then add this code to your functions.php file. You may want to backup your WordPress website before you make updates to that on there.
/** * Add year shortcode * * @author WPSnacks.com * @link https://www.wpsnacks.com */ function the_year() { $year = date('Y'); return $year; } add_shortcode('year', 'the_year');
Then if that works for you when you want to use the shortcode you type in [year] and it would display it.
Leave a Reply