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.
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.
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'
)); ?>
Linux has a convenient feature of running cronjob which will get executed at the correct…
As famous Tamil poet Auvaiyar said "Katradhu Kai Mann Alavu, Kallathathu Ulaga Alavu" which is…
Terraform Cheatsheet with pdf. You can download Terraform Cheatsheet pdf with all Terraform CLI commands…
I was planning to do Terraform certification a long time ago. I have worked on…
As a user of both of these services has got multiple benefits with both of…
You need not memorize these important docker commands. Repeated usage will make it easy for…
This website uses cookies.