Mika MAtikainen

Apr 15, 2020 · 4 min read

How do I use the current year dynamically in my WordPress posts?


function wpsc_year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'wpsc_year_shortcode');        

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This