I want to create a shortcode function that returns: 2021 - 2022
And then it would update next year automatically.
This is the (broken) code I have so far:
function current_class_year(){
return date('Y'); // current year
return date('Y', strtotime('+1 year')); // next year
}
add_shortcode( 'current_class_year', 'current_class_year' );
Thanks for any help.