i have rather huge meta_query here , hangs @ execution: browser won't load page, goes on loading ...
as far know should work after wp 4.1 (i have it). tried updating 4.2 no avail.
am doing terribly wrong here? info.
$meta_query = array( 'relation' => 'and', // if $level given array( 'relation' => 'or', array( 'key' => 'co_level', 'value' => $level, 'compare' => 'in' ), array( 'relation' => 'and', array( 'key' => 'co_program2', 'value' => $program_ids, 'compare' => 'in' ), array( 'key' => 'co_level2', 'value' => $level, 'compare' => 'in' ), ), array( 'relation' => 'and', array( 'key' => 'co_program3', 'value' => $program_ids, 'compare' => 'in' ), array( 'key' => 'co_level3', 'value' => $level, 'compare' => 'in' ), ), ), // if $year given array( 'relation' => 'or', array( 'key' => 'co_year', 'value' => $year, 'compare' => 'in' ), array( 'relation' => 'and', array( 'key' => 'co_program2', 'value' => $program_ids, 'compare' => 'in' ), array( 'key' => 'co_year2', 'value' => $year, 'compare' => 'in' ), ), array( 'relation' => 'and', array( 'key' => 'co_program3', 'value' => $program_ids, 'compare' => 'in' ), array( 'key' => 'co_year3', 'value' => $year, 'compare' => 'in' ), ), ), ); $args = array( 'post_type' => 'course', 'posts_per_page' => -1, // posts 'orderby' => array('meta_value_num'=>'asc','menu_order'=>'asc'), // order given meta value , menu_order 'meta_key' => $meta_key_orderby, 'order' => 'asc', 'meta_query' => $meta_query, );
Comments
Post a Comment