Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "<hr>Last SQL-Query: {$the_query->request}";
- 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
- $the_query = new WP_Query
- (
- array
- (
- 'meta_key'=> 'client',
- 'orderby' => 'meta_value',
- 'order' => 'DESC'
- )
- );
- echo "<hr>Last SQL-Query: {$the_query->request}";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement