If you have a magazine blog or just like newspapers want to display current date and time on your blog then this post is for you. Now people are moving from a simple blog to professional magazine style theme blog to add both features and looks.
If your blog posts displaying the date of publishing then it is a great idea to display the current date that makes your blog a little bit more professional. It gives a complete idea at a glance that how frequently the blog posts update and builds a trust relationship with your audience.
You might think to add this functionality require so many steps then you need to think again because it is simple and uses only single line code.
1# Coding Method To Setup Current Date and Time
Step 1: Go to your admin dashboard of WordPress and click on the editor and select the theme where you want to enable this features.
Step 2: Now from the right side column select the header.php theme file. Now from the editing area search for </head> or </header> and paste the below given code before it
This code will pull the date format you have set in under Settings > General -> date format.
If you want to give your own style or date format then you can use this command instead of above.
The code given above will show the date format as Thursday, 12th September 2017.
You can also try other date formats if you don’t the above one just visit the PHP Date Manual for other parameters.
2# Second Method is using the plugin
The second method is using the plugin which easy and safe. There are not so many plugins those offers this type of functionality but thanks, Date and Time Widget is there. The plugin is not updated frequently but we test it with WordPress 4.8.1 and it works without any issues.
How To set up current Date and Time Widget plugin for WordPress:
Step 1: Go to WordPress dashboard and click Plugins-> Add new and search for Date and Time Widget.
Step 2: The search result will show the plugin and now click on the Install and then Activate.
Step 3: After installing the plugin go to Appereance-> Widget and look for Widget called Date and Time.
Step 4: Select the Widget and save it under the Header Widget area as shown in the screenshot.
Step 5: After selecting the Widget to go to Header Widget area and configure the color, date and time format, Date font family and size.
Step 6: Save the Widget and now go to your website and see the magic!!