With the following…
$results = $wpdb->get_results(“SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts
FROM $wpdb->posts WHERE post_date !=
‘0000-00-00 00:00:00’ AND post_status = ‘publish’ GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC”);
… which returns the following numbers: $month->year (ie. 2006), $month->month (ie. 9) and $month->posts ie. 236)…
***How can I make sure I can back the NAME of the month and not just the number?***
- The topic ‘How to get month NAME not number?’ is closed to new replies.