How to Display Today’s Date in WordPress (2 Easy Methods)

How To Display Today’s Date In WordPress

Like to display today’s DATE in WordPress? Here are some easy and simple methods you can try.

Displaying the Date in your article helps readers know when the article was published. Many authors display the Date in their articles, and many don’t. But it’s not a necessity. If you want to show, then go for it, and if you don’t wish to, then don’t.

Many websites, blogs, online journals want to display the Date as it reflects the continuity of the site or blog. In addition, how recent the content was published.

So, without further delay, let’s move towards Displaying Today’s Date in WordPress. 

This post will talk about four different methods for showing today’s Date in WordPress:

  • First, By using a specific theme.
  • Second, By using Plugins.
  • Third, Using Manual codes.
  • fourth, Using a Shortcode

Methods to show today’s Date in WordPress

 We can use different methods to display today’s Date in WordPress. Let’s discuss them one by one.

Method 1: By Using a Specific Theme

In WordPress, Many themes can display today’s Date without any coding. Such as, in the ColorMag theme, you can easily turn it on and off. 

You can find out if your theme supports showing Date or not. By Clicking the Appearance option and selecting the Customize option. Then click on the show date. Further, click on the save and publish button.

Appearance >>Customize >> Show Date >> Save>> Publish

 

Of course, this may be different on a different theme.

If your theme supports this feature, you can check it in the “Header Options” Usually, this area controls the date option.

header option >>show date >>save and publish.

these were the steps you need to follow to display today’s date using a specific theme.

Method 2:  Using plugins.

There are not many plugins for displaying the Date. Because you can add it with code, also, websites don’t want to show today’s Date exclusively.

i.WP Date and Time Shortcode plugin.

The plugin allows you to show past, future, and present dates on any of your WordPress posts. This is done by using a shortcode.

 You can Install and activate the plugin using our step-wise guide or follow the below suggest steps-

In your dashboard, on the left, go to-

  • plugins >> Add New >>Search WP Date and Time Shortcode plugin>>install .

After installing, go to the plugin page. There are many shortcode options.

Select the current date option. The shortcode option is given below.

[wpdts-date-time]

Selecting The Current Date shortcode will show the current date and time based on your WordPress settings. Save the settings and check.

ii. Date and Time Widget plugin.

This plugin gives you a new widget that you can use to insert the current Date and Time into any area.

Moreover, it lets you set up formatting, font size, and custom colors.

You can Install and activate the plugin using our step-wise guide or follow the below suggest steps-

In your dashboard, on the left, go to-

  • plugins >> Add New >>Search Date and Time Widget plugin>>install .
  •  Then, Appearance >> Widgets >> new Date and Time widget 

 

Go through the settings and save.

 you will see today’s Date on the front-end

Method 3: Display Today’s Date Using codes( manually )

This method displays the Date directly from the admin panel. 

For this, 

On your WordPress Dashboard

  • Go to Settings >> General
  • Select the Date Format you want.

Add the code mentioned below. You can see the Date on your WordPress website. 

<?php echo date(get_option(‘date_format’)); ?>

Method 4: Display Date & Time Using a Shortcode

At first, We’ll create a shortcode for this method and then use it to display Date and time anywhere on our WordPress website.

Then, add the code below using the custom Code Snippets plugin ( a site-specific plugin) or your theme’s functions.php file.

 function wpb_date_today($atts, $content = null) {

extract( shortcode_atts( array(

        'format' => ''

    ), $atts ) ); 

 

if ($atts['format'] == '') {

$date_time .= date(get_option('date_format')); 

} else { 

$date_time .= date($atts['format']); 



return $date_time;



add_shortcode('date-today','wpb_date_today'); 

This code displays the current Date. Add this shortcode anywhere on your site:

[date-today]

 This will display the Date in the default date format in your WordPress settings. You can change the date formate.

To conclude, these are the different methods you can use to display today’s Date in WordPress. You can choose any of the above-stated methods- By specific theme, by plugins, by manual code, or by using shortcode. 

We hope this has helped you display today’s date in WordPress.

Go check our another guide on how to display the most accurate comment on WordPress.

 

Leave a Comment