the_time()
does show the publish time of a post;
outside the loop, this could be random, possibly the last or first post on the page.
http://codex.wordpress.org/Function_Reference/the_time
consider to use date()
instead; http://php.net/manual/en/function.date.php
as for the formatting, you are confusing css ids and classes;
http://www.w3schools.com/css/
OK, I used this code for the date: <?php echo date('l jS, F, Y') ?>
For the css, I added this code but the date isn’t aligning to the right of the blog page:
`.todaysdate {
float: right;
color: #444;
font-size: 20px;
line-height: 1.625em;
padding: 0 1.2125em;
margin-top: 10px;
font-weight: bold;
}`
It works when I use .todaysdate but not when I use #todaysdate. Thanks 🙂
I’m using a 2012 child theme on the site.
You need to use .todaysdate
(period for class, hashtags are for id)
It works! Now I know the difference between period for class, hashtags are for id.