Support

Account

Home Forums Front-end Issues Strange results when using orderby a number field Reply To: Strange results when using orderby a number field

  • So then that should not be causing the problem of them not being sorted properly. The code you have is correct.

    
    <?php 
      $mypost = array(
        'post_type' => 'listing',
        'posts_per_page' => 20,
        'meta_key' => 'revenue_number',
        'orderby' => 'meta_value_num',
        'order' => 'DESC'
      );
      $loop = new WP_Query($mypost);
    ?>
    

    What is after this? What does you loop look like?