I'm trying to query posts using WP_Query and meta_query parameters:
$args = array(
'post_type' => 'produkty',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'produkt_aktywny',
'value' => '1',
'compare' => '='),
array(
'key' => 'produkt_dostepnosc',
'value' => '1',
'compare' => '=')
)
);
$query = new WP_Query( $args );
What should I add to order the results by two other keys ('produkt_kategoria' and 'produkt_cena')? There's nothing about it in WP Codex, but this:
"Do you know how to sort the query if the meta_value is an array? Write it here :)"
According to this, I believe sorting by multiple meta values is possible.