What is the error query_posts?

Deduce records with sorting by 2 custom fields, first, entries which have an arbitrary field, then there are no custom fields. Everything works if you leave the sort by one custom field, but if you add the second, then the page just endlessly loading.

What could be the error?

$args = array(
 'post_type' => 'catalog',
 'posts_per_page' => 8,
 'meta_query' => array(
 'relation' => 'AND',
 'catalog_max' => array(
 'relation' => 'OR',
array(
 'key' => 'catalog_max',
 'compare' => 'NOT EXISTS',
),
array(
 'key' => 'catalog_max',
 'compare' => 'EXISTS',
),
),
 'ratings_average' => array(
 'relation' => 'OR',
array(
 'key' => 'ratings_average',
 'compare' => 'NOT EXISTS',
),
array(
 'key' => 'ratings_average',
 'compare' => 'EXISTS',
),
)
),
 'orderby' => array('catalog_max' => 'DESC', 'ratings_average' => 'DESC'),
);

query_posts($args);
June 8th 19 at 16:31
0 answer

Find more questions by tags WordPress