WordPress.org

Ready to get started?Download WordPress

Forums

I'm lost...three letter month abbreviation? (3 posts)

  1. sketcher
    Member
    Posted 8 years ago #

    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

  2. Kafkaesqui

    Posted 8 years ago #

    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>

  3. sketcher
    Member
    Posted 8 years ago #

    Wow that's great! Thank you! :) It worked perfectly.

Topic Closed

This topic has been closed to new replies.

About this Topic