Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (in_array($wp_query->query_vars['meta_key'], array("pa_pph","pa_tonnage","pa_capacity","pa_horsepower","pa_zones","pa_screw_diameter"))) {
- $wp_query->query_vars['orderby'] = "meta_value_num";
- // this is what breaks the sorting... BUT I get all the posts that I need.
- // if I remove this, then I only get posts with the meta data
- $wp_query->query_vars['meta_query'][] = array('key'=>$wp_query->query_vars['meta_key'],'compare'=>'NOT EXISTS');
- $wp_query->query_vars['meta_query']['relation'] = "OR";
- $wp_query->get_posts();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement