Advertisement
bananamariap

ts query

Aug 28th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. $m_query = array(
  2. 'relation' => 'OR',
  3. 'mls_no_maine' => array(
  4. 'key' => $prefix . 'mls_no_maine',
  5. 'compare' => 'EXISTS',
  6. ),
  7.  
  8. 'mls_no_maine' => array(
  9. 'key' => $prefix . 'mls_no_maine',
  10. 'compare' => 'NOT EXISTS',
  11. ),
  12.  
  13. );
  14.  
  15.  
  16. $args = array(
  17. 'post_type' => array( 'ts-listings' ),
  18. 'post_status' => array( 'publish' ),
  19. 'posts_per_page' => '-1',
  20. 'meta_query' => $m_query,
  21. // 'meta_key' => $prefix . 'mls_no_maine',
  22. 'orderby' => 'meta_value',
  23. 'order' => 'ASC',
  24. );
  25.  
  26. $q = new WP_Query($args);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement