| 46 | | if ( $monthyears = $wpdb->get_results( "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC " ) ) { |
| | 46 | $types = "'" . implode("', '", get_post_types( array( 'public' => true, 'can_export' => true ), 'names' )) . "'"; |
| | 47 | $stati = "'" . implode("', '", get_post_stati( array( 'internal' => false ), 'names' )) . "'"; |
| | 48 | if ( $monthyears = $wpdb->get_results("SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_type IN ($types) AND post_status IN ($stati) GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date ASC ") ) { |