Support

Account

Home Forums General Issues Compound Custom Query based on custom fields

Unread

Compound Custom Query based on custom fields

  • I have a problem with a custom query that is not working. I need to create an AND/OR query. I have the following options array structure that I pass to query_posts, is it possible whit custom fields?

    array (size=4)
      'relation' => string 'AND' (length=3)
      0 => 
        array (size=4)
          'key' => string 'min_price' (length=9)
          'value' => string '150' (length=3)
          'type' => string 'NUMERIC' (length=7)
          'compare' => string '>=' (length=2)
      1 => 
        array (size=4)
          'key' => string 'min_price' (length=9)
          'value' => string '10000' (length=5)
          'type' => string 'NUMERIC' (length=7)
          'compare' => string '<=' (length=2)
      2 => 
        array (size=2)
          'relation' => string 'OR' (length=2)
          0 => 
            array (size=3)
              'key' => string 'style' (length=5)
              'value' => string '"haamatka"' (length=10)
              'compare' => string 'LIKE' (length=4)
Viewing 1 post (of 1 total)

The topic ‘Compound Custom Query based on custom fields’ is closed to new replies.