• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Gokul Deepak

GoCool and Debug

  • Home
  • WordPress
  • Android
  • How to
  • About Me
Home » Wordpress » How to Display Today’s Date in Wordpress

How to Display Today’s Date in WordPress

June 28, 2017 by GokulDeepak Leave a Comment

Many blogs and websites use Magazine style of theme and so the like to add date in the page. It was first started by newspapers but now many non newspaper blogs too wanted to display date. Displaying todays’s date looks professional. Before somedays adding Today’s date was difficult but now after many updates it is very easy in wordpress to display Today’s date in any wordpress theme. Yes, You can use it in Studiopress, Genesis, Theme forest and in any theme. Let me share this simple method to display Today’s date in WordPress. This method is not onl exclusive for wordpress but you can also apply this for any PHP based websites.

Display Today’s Date:

Place this code in header.php

<?php echo date('l jS F Y'); ?>

If you are using Genesis theme then simply paste this using Simple hook theme.

The above code will display the date in the following format:

Friday, 1st September 2017

You can also change the format of this date using PHP format.

How to Display Today’s Date in WordPress

To Add Color in Date:

Using CSS you can change the colors. To use css add the date template tag like this:
<span class="date"><?php echo date('l jS F Y'); ?></span>

Now in your theme’s style sheet you can add CSS, like this:
.date {
color: blue;
border: 1px solid #CCC;
}


Method 2:

Go to Settings > General and select the date format in there and simply add this code instead of the above one:
<?php echo date(get_option('date_format')); ?>

Related

Filed Under: Wordpress

Authored by Gokul Deepak S

Reader Interactions

Leave a Reply Cancel reply

Primary Sidebar

Popular Posts

  • How to find the date of the Facebook group it was created
  • Home
  • Downgrade from Lollipop to Kitkat for Micromax Canvas A1 (Android One)
  • How to remove Linux OS in Tamilnadu Government Free Laptop
  • How to block access to the wp-content uploads folder
  • How to add ads.txt on Bluehost
  • Combine two separate files line by line in Notepad++

Recent Posts

  • Can’t connect to Ubuntu with SSH
  • Change Timezone in Ubuntu 20.04 – Simple method
  • Output for timedatectl list-timezones
  • PM2 Cheatsheet – Important Commands
  • MongoDB Terminal commands – Cheatsheet

Archives

Categories

  • Android
  • Apache
  • Blogger
  • Computer Tips
  • Earn
  • Facebook Tips
  • Git
  • Google Tips
  • How to
  • Laptop Tips
  • Laptops
  • Linux
  • Mobile
  • MongoDB
  • Nginx
  • Notepad++
  • PostgresQL
  • Ubuntu
  • Wordpress
  • Xenforo

Tags

Android Android One Bluehost Comparisions Custom ROM Elementor Facebook Genesis Genesis Sample Theme Google Drive How to Lineage OS OnePlus One OwnCloud Rooting Smartphones Stock ROM Studiopress Wordpress plugin

Copyright © 2021 · Maintained by GokulDeepak