Search
Close this search box.

Custom Shortcode In WordPress To Add Current Year To Elementor Footer Template

[updated_on]
Share this post:

Here is the code to copy into your functions.php file or into the My Custom Functions plugin.

Once the code below is in place, put the shortcode [year] wherever you want the current year to appear on your site.

function current_year_shortcode() {
  $year = date('Y');
  return $year;
}
add_shortcode('year', 'current_year_shortcode');
Share this post:

Leave a Comment

Your email address will not be published. Required fields are marked *

WPLearningLab