Advertisement
Guest User

Untitled

a guest
Mar 26th, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. $querystr = ”
  2. SELECT $wpdb->posts.*, YEAR(post_date) AS year,
  3. MONTH(post_date) AS month,
  4. DAYOFMONTH(post_date) AS dayofmonth
  5. FROM $wpdb->posts, $wpdb->postmeta
  6. WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id
  7. AND $wpdb->postmeta.meta_key = ‘epicredvote’
  8. AND $wpdb->posts.post_status = ‘publish’
  9. AND $wpdb->posts.post_type = ‘post’
  10. GROUP BY ID
  11. ORDER BY LEFT($wpdb->posts.post_date, 10) DESC, $wpdb->postmeta.meta_value+0 DESC
  12. “;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement