Adding / Embedding Current Date & Time to WordPress


The WordPress theme I am using on one of my sites has a widget area to embed text at the footer of the site. I saw it as a great place to include the popular copyright text found in most website Copyright © 2017, ProductNameHere

I visited the site today and found out I haven’t updated the year to 2017. To permanently fix this, I knew the solution was to code a WordPress shortcode that will display the current year. I decided to research if a plugin exist for it before I code one up myself. Thankfully, I stumbled on Shortcode for Current Date plugin.The plugin allows you to display current date and time in any supported PHP date format.Back to my problem. I was able to solve it by adding this shortcode (powered by the aforementioned plugin) to the footer widget area.It’s worth noting you can also use this shortcode (and any WordPress shortcode) in a post and page.
1287 Views
ads here