French date format

Posted by kwek-kwek on Stack Overflow See other posts from Stack Overflow or by kwek-kwek
Published on 2010-05-05T21:00:27Z Indexed on 2010/05/05 21:18 UTC
Read the original article Hit count: 269

Filed under:
|

I am a newbie in PHP & wordpress. I wanted to know how to make this codde renders the date formating in french (e.g. 5 Fev) when your on the french side but in english format in English (e.g. Jan 5)

Here is my code:

<?php
if (strtolower(ICL_LANGUAGE_CODE) == 'en') {$sidePosts = get_posts('cat=3,4,5,19&posts_per_page=5&order=DESC&orderby=date');}
if (strtolower(ICL_LANGUAGE_CODE) == 'fr') {$sidePosts = get_posts('cat=9,10,11,17&posts_per_page=5&order=DESC&orderby=date');}
foreach($sidePosts as $sidePosts) {
    $array = (array) $sidePosts;
    print("<li>");
    print("<span class='date'>".get_the_time('M j', $array[ID])."</span>");
    print("<a href='".get_permalink($array[ID])."' title='".$array[post_title]."'>".$array[post_title]."</a>");
    print("</li>");
}
?>

© Stack Overflow or respective owner

Related posts about php

Related posts about php5