Display Current Year in Footer
-
Hello – How can I dynamically show current year in footer, So I dont have to change it every year manually
©2019 My Company .
Hello,
Unfortunately there is no such option in the theme to use dynamic copyright.
You can read and follow the below article that might help you out:
https://www.wpbeginner.com/wp-tutorials/how-to-add-a-dynamic-copyright-date-in-wordpress-footer/
Best Regards.
Hello,
To display the dynamic year in footer you can use the below code in function.php :
function year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'year_shortcode');
After placing the above code you have to use this short code “[year]” inside “Copyrights text” area, under theme settings >> Footer.
Screenshot for clarification: https://jmp.sh/sUKHtFb
I have tested this code on my test site and it works just perfectly fine on my test site.
Best Regards.
Thanks for this tips guys, it works perfecctly for me.
One question : it is not possible to add this code in the functions.php of the child theme. So does the code stay after a Woodmart theme update ?
Thanks,
Hello,
Yes, you can add the code to the functions.php of the child theme. This way, the code will stay intact even after a Woodmart theme update.
Best Regards.