WordPress.org

Support

Support » How-To and Troubleshooting » I’m lost…three letter month abbreviation?

I’m lost…three letter month abbreviation?

  • Hello,

    This is my first post here and also my first attempt to make my first WordPress theme. I’ve encountered a problem though..and I can’t seem to find an answer either here on the support forums or anywhere else. And I’ve looked. 🙂 Anyway, my problem is this: I want to display, say on my homepage, a list of the latest posts on my blog. What I want to do is display next to the post itself, the date, in this format:

    Nov 7

    the actual HTML code I currently use is this:

    <span class="month">Nov</span><span class="day">7</span>
    which means the month and the date will each have to be inside a HTML tag..

    So my problem is that I don’t know how to display the month in an abbreviated form – “Nov”..

    Can anyone here help me with this please? I would deeply appreciate it..

    My regards to you, gentlemen.
    Gabriel

Viewing 2 replies - 1 through 2 (of 2 total)
  • Kafkaesqui

    @kafkaesqui

    Use two instances of the_time() template tag with the appropriate date format string:

    <span class="month"><?php the_time('M'); ?></span> <span class="day"><?php the_time('j'); ?></span>

    Wow that’s great! Thank you! 🙂 It worked perfectly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘I’m lost…three letter month abbreviation?’ is closed to new replies.
Skip to toolbar