Created
January 9, 2011 23:24
-
-
Save johanbrook/772137 to your computer and use it in GitHub Desktop.
Kolla vid "and post_type = 'post'". Jag vill ha ut _både_ posttypen "post" och "quickie". How, oh how?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"SELECT DISTINCT MONTH( post_date ) AS month , | |
YEAR( post_date ) AS year, | |
COUNT( id ) as post_count FROM $wpdb->posts | |
WHERE post_status = 'publish' and post_date <= now( ) | |
and post_type = 'post' | |
GROUP BY month , year | |
ORDER BY post_date DESC" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment