Posted By

kayue on 12/31/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

anhonestboy


Wordpress author post count


 / Published in: SQL
 

  1. SELECT `post_author` AS 'id', display_name AS 'name', `post_date` AS 'date', `post_title`, `guid`
  2. FROM `wp_posts` p
  3. LEFT JOIN wp_users u ON u.ID = p.post_author
  4. WHERE `display_name` IN('Nick Lett','Evan Silver','Ramon Diaz','Alex Milner','Sheraz Amin')
  5. AND `post_status` = 'publish'
  6. AND post_date_gmt > '2010-11-1'
  7. AND post_date_gmt < '2010-11-30'
  8.  
  9.  
  10. # Get Count
  11. SELECT `post_author` AS 'id', display_name AS 'name', count( * ) AS 'count'
  12. FROM `wp_posts` p
  13. LEFT JOIN wp_users u ON u.ID = p.post_author
  14. WHERE `display_name`
  15. IN (
  16. 'Nick Lett','Evan Silver','Ramon Diaz','Alex Milner','Sheraz Amin','Davis Huynh'
  17. )
  18. AND `post_status` = 'publish'
  19. AND post_date_gmt > '2010-11-1'
  20. AND post_date_gmt < '2010-11-30'
  21. GROUP BY `post_author`

Report this snippet  

You need to login to post a comment.