Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. echo "<hr>Last SQL-Query: {$the_query->request}";
  2.  
  3. SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND ( wp_postmeta.meta_key = 'client' ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value DESC LIMIT 0, 2
  4.  
  5. $the_query = new WP_Query
  6. (
  7. array
  8. (
  9. 'meta_key'=> 'client',
  10. 'orderby' => 'meta_value',
  11. 'order' => 'DESC'
  12. )
  13. );
  14.  
  15. echo "<hr>Last SQL-Query: {$the_query->request}";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement