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 want to show the range of my houses as per size. Ranges will be:


HTML code

<select name="size" id="search-type" class="text<?php echo $select_wide; ?>">
    <option value=""><?php _e('Size..', TS_DOMAIN); ?>&hellip;</option>
    <option name="size" value="1">1-50 M2</option>
    <option name="size" value="5000">50-100 M2</option>
    <option name="size" value="10000">100-150 M2</option>
    <option name="size" value="15000">150-200 M2</option>
    <option name="size" value="20000">200-250 M2</option>
    <option name="size" value="999999">+250 M2</option>     

PHP code

// check size custom fields

    $meta_query_size = array(    
        'key' => '_size',
        'value' => array($search_get['size'],10000),
        'compare' => 'BETWEEN',
        'type' => 'NUMERIC'

Note: If I use the query below, then it works, but not for between.

// check size custom fields

    $meta_query_size = array(
            'key' => '_size',
            'value' => $search_get['size'],
            'compare' => '<=',
            'type' => 'NUMERIC'

Please advise.

share|improve this question

Perhaps something wrong with your incoming variable? try without $variable. simply with already setted value and check results.

  'value' => array(100,10000)
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.