Forum Replies Created

Viewing 1 replies (of 1 total)
  • tcaneeaglepub

    (@tcaneeaglepub)

    I am also experiencing this problem where ‘OR’ meta queries do not sort properly. Using WP version 4.8.2. It seems to only want to sort by the first named clause. Was anyone able to figure out a solution? My meta query section:

    ‘meta_query’ => array(
    ‘relation’ => ‘OR’,
    ‘cornerstone_clause’ => array(
    ‘key’ => ‘_yst_is_cornerstone’,
    ‘compare’ => ‘EXISTS’,
    ‘type’ => ‘NUMERIC’,
    ),
    ‘count_clause’ => array(
    ‘key’ => ‘erp_post_views_count’,
    ‘compare’ => ‘>’,
    ‘value’ => 0,
    ‘type’ => ‘NUMERIC’,
    ),
    ),
    ‘orderby’ => array(
    ‘cornerstone_clause’ => ‘DESC’,
    ‘count_clause’ => ‘DESC’,
    ),

Viewing 1 replies (of 1 total)