How to Display Today’s Date in WordPress37

How-to-Display-Today’s-Date-in-WordPress

The trend of displaying date has been so popular that you will find the date is displayed in every newspaper, blogs or other social sites. So, if you want to follow the trend this is what you need to do.

Procedure

Open your theme file and paste the code below, most probably you can post the code in the header.php file:

\<?php echodate('l jS F Y'); ?>

Output: Monday, 11th September 2017

 

If you want to change the displaying format you can go to PHP Date Manual: http://php.net/manual/en/function.date.php and choose the code as you require.

Also, you can go to Settings > General and select the date format. But you need to paste the code below instead of above code:

<?php echodate(get_option('date_format')); ?>