Shortcoding: Dates

I see so many websites with HTML footers containing expired copyright dates. You shouldn’t have to remember to update the year all the time.

To avoid ever having to think about this, use a shortcode in a theme to add a data anywhere. Add the following code to your functions.php file:

Then just call any current date formate. For the current year, simple add the following right in your text editor:

But change “thedate” to “date” if you use the code I provided. I changed it to “thedate” so the shortcode wouldn’t execute.