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

Share this post:
Share on facebook
Share on twitter
Share on reddit
Share on linkedin
Share on pinterest
Share on pocket
Share on email
Share on print

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 2023 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:
Share on facebook
Share on twitter
Share on reddit
Share on linkedin
Share on pinterest
Share on pocket
Share on email
Share on print
Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on email

Responses

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

WPLearningLab