Skip to content

Instantly share code, notes, and snippets.

@johanbrook
Created January 9, 2011 23:24
Show Gist options
  • Save johanbrook/772137 to your computer and use it in GitHub Desktop.
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?
"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