Is there any elegant way to add the year to the post date in the black box to the left of posts? We have a site that goes back several years and would love for that to be clearer....
Add Year to Post Date
5 posts from 4 voices-
Posted 1 year ago #
-
Hello kaylesimon,
You'll need to open up all of the various blog post type format files and change:
<span class='date-day'><?php the_time('d') ?></span> <span class='date-month'><?php the_time('M') ?></span>to
<span class='date-day'><?php the_time('d') ?></span> <span class='date-month'><?php the_time('M') ?></span> <span class='date-year'><?php the_time('Y') ?></span>These are all in the includes folder of your theme files and are labeled format-standard.php, format-gallery.php etc. Some of them don't naturally have dates and you might want to keep it that way in which case you won't need to edit anything in them (format-link.php for example).
Then, add the following to your custom.css file located in the css folder:
.date-year { display: block; text-align: center; }Make sure to save all the files and upload them back to the server when you are done. You can use a free FTP program like FileZilla to download and upload the files via FTP if you don't already have a program to do this with.
Regards,
Devin
Posted 1 year ago # -
Hey Devin,
Works like a charm, thanks much! And thanks for leaving it here for others to find.
I'd like to make the year a little smaller, though, maybe by one point. Is there an easy fix and if so, where can I add the code?
Thanks!
JanetPosted 3 months ago # -
Hi,
Try this on your custom.css
.date-year { display: block; text-align: center; font: 9px Helvetica, Arial, sans-serif; text-transform: uppercase; }Change the pixel size of the font.
Regards,
IsmaelPosted 3 months ago # -
YES! Thanks so much, Ismael. That works.
-Janet
Posted 3 months ago #
Topic Closed
This topic has been closed to new replies.














