French date format
- by kwek-kwek
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>");
}
?>