Tagged: , ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11783

    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….

    #73045

    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

    #73046

    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!

    Janet

    #73047

    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,

    Ismael

    #73048

    YES! Thanks so much, Ismael. That works.

    -Janet

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Add Year to Post Date’ is closed to new replies.