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

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 2024 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:


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