WordPress.org

Forums

Customize the date for stacked Month, Day, Year layout? (4 posts)

  1. athenagold
    Member
    Posted 6 years ago #

    Hello,

    I'm customizing a blog and would like to have the date display in a box so that it is stacked like this:

    JUL
    07
    08

    I cannot seem to figure out how to do this. I tried this:

    <?php the_date('M'); ?>
    <?php the_date('d'); ?>
    <?php the_date('y'); ?>

    But it will only display the first one, Month.

    Ideally, I'd like to just list them out in one call - <?php the_date('M d y'); ?> but somehow place spans between each one, so that I can style them in my CSS.

    Any ideas?

    Thank you!!

  2. allstar
    Member
    Posted 6 years ago #

    Try using 'the_time()' for all 3.

    Sounds silly but it works because the_date will only work once per post... :)

  3. irishjayhawk
    Member
    Posted 6 years ago #

    Instead of making another topic, I thought I'd bump this for a quick question.

    I want to achieve the same thing but I DON'T want it to display on every post, but rather just the first one.

    I'm using the_date(), but it won't display properly.

  4. t31os
    Member
    Posted 6 years ago #

    Try using 'the_time()' for all 3.

    Sounds silly but it works because the_date will only work once per post... :)

Topic Closed

This topic has been closed to new replies.

About this Topic