Bonjour,
Dans mon code, je souhaite afficher les mois en français mais je ne trouve pas la solution. Voici mon code, les mois s'affichent actuellement en anglais. Mon code n'est peut-être pas très bon mais j'ai eu un petit peu de mal pour arriver à afficher les articles de la sorte.
Merci d'avance pour votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 <?php echo date( 'F', mktime(0, 0, 0, $month) ); $days = $wpdb->get_col("SELECT DISTINCT DAY(post_date) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND MONTH(post_date) = '".$month."' AND YEAR(post_date) = '".$year."' ORDER BY post_date ASC"); foreach($days as $day) : ?> <?php $theids = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND MONTH(post_date)= '".$month."' AND YEAR(post_date) = '".$year."' AND DAY(post_date) = '".$day."' ORDER BY post_date DESC"); ?> <?php foreach ($theids as $theid): ?> <a style="color: #444;" href="<?php echo get_day_link($year, $month, $day); ?>"><?php echo $theid->post_title; ?> </a> <?php endforeach;?> <?php endforeach;?>
Partager