• Hello πŸ™‚

    I would like to display the months in three digits.

    I.e. MAY – APR – SEP instead of having the whole month name displayed (in order to display it into a small graphic calendar).

    Is there a way to do it ? Has it already been done ? Does a reference exist for it ?

    Thank you very much in advance πŸ™‚

Viewing 6 replies - 1 through 6 (of 6 total)
  • http://php.net/date

    Is that any good? M is the code to make three-letter month codes. So you’d do something like

    the_date('M');

    It’s case-sensitive though.

    WordPress has a calendar built in, you know. The template tag is <?php get_calendar(); ?>.

    Go to the options menu, and then down to “Default date format”, and change the value to ‘M j, Y’. Minus the quotes of course.

    Thread Starter Co

    (@co)

    Thank you very much πŸ™‚ The ‘M’ works perfectly !
    Have a wonderful week-wend.

    I’m glad it works for you πŸ™‚ If you wanted to make it all caps, you can use CSS, the rule is

    .whatever-selector-youre-using {
    text-transform: uppercase; }

    Thread Starter Co

    (@co)

    Hello, it’s me again πŸ™‚

    I’ve just tried out the M trick with the french version of WordPress, but it doesn’t seem to work as my June month (juin) appears entirely (4 digits).

    Any idea of what I may be doing wrong ?

    Thanks !

    Thread Starter Co

    (@co)

    Well I did find the solution by myself. In fact WordPress is very intelligent πŸ˜‰ (more than myself, lol)

    The months june and july (respectively Juin et Juillet) do have the same first 3 digits. They need the 4th digit in order to establish a differenciation.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘3 digits months’ is closed to new replies.