Could someone help me align the date to the right margin of site
I added the php code for today's date to the header.php file: http://pastebin.com/7AEQaFNS
I added this code to the .css file: http://pastebin.com/gb5hnkya
What am I doing wrong?
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.
consider to use
date() instead; http://php.net/manual/en/function.date.php
as for the formatting, you are confusing css ids and classes;
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:
padding: 0 1.2125em;
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.
This topic has been closed to new replies.