WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to query posts using WP_Query and meta_query parameters:

$args = array(
    'post_type' => 'produkty',
    'meta_query' => array(
        'relation' => 'AND',
            'key' => 'produkt_aktywny',
            'value' => '1',
            'compare' => '='
            'key' => 'produkt_dostepnosc',
            'value' => '1',
            'compare' => '='

$query = new WP_Query( $args );

What should I add to order the results by two other meta keys ('produkt_kategoria' and 'produkt_cena')?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.