SELECT YEAR ( `post_date` ) AS `year` , SQL_TSI_MONTH ( `post_date` ) AS `month` , COUNT ( `ID` ) AS `posts` FROM `wp_posts` WHERE `post_type` = ? AND `post_status` = ? GROUP BY YEAR ( `post_date` ) , SQL_TSI_MONTH ( `post_date` ) ORDER BY `post_date` DESC 