Current Year Shortcode

,

Sometimes you will want to output the current year within your site.  It is very useful with not having to update the Copyright notice in the footer of your site. Place the following code within your functions.php in the child theme and you are good to use the [curYear] shortcode wherever you need it.

function curYear () {
    return date("Y");
}
add_shortcode("curYear","curYear");

 

Skills

Posted on

April 1, 2022

Submit a Comment

Your email address will not be published.