title: How to fetch Custom Post product in ascending order using orderby custom field
body: <p>I am fetching custom post product and my requirement is fetching product in</p>
  
  <p>Ascending order using custom product filed.</p>
  
  <pre><code>&lt;?php
  # 
  # rt-theme product loop
  #
  global $args,$wp_query; 
  
  //column
  
  $box_counter = 0;
  
  if(is_tax()) $args = array_merge( $wp_query-&gt;query, $args);
  
  
  
   $args1['orderby'] = 'wpcf-watt';
   $args2['order'] ='ASC';
   $args = array_merge($args, $args1);
  
   $args = array_merge($args, $args2);
  
  query_posts($args); 
  
  $product = array();
  $postCount = 0;
  
  if ( have_posts() ) : while ( have_posts() ) : the_post();
  
  
  ?&gt;
  
      &lt;?php
      //box class
  
      $product[$postCount]['title']       =   get_the_title();
      $product[$postCount]['thumb']       =   find_image_org_path(get_post_meta($post-&gt;ID, THEMESLUG.'product_image_url', true));
      $product[$postCount]['image']       =   @vt_resize( '', $thumb, $w, $h, ''.$crop.'' );
      $product[$postCount]['short_desc']  =   get_post_meta($post-&gt;ID, THEMESLUG.'short_description', true);
      $product[$postCount]['permalink']   =   get_permalink();
      $product[$postCount]['watt']        =   get_post_meta($post-&gt;ID, 'wpcf-watt', true);    
  
      $postCount = $postCount + 1;
      ?&gt;
  
  &lt;?php endwhile?&gt;
  &lt;?php
  
      echo "&lt;pre&gt;";print_r($product);
  
  
  
  ?&gt;
  
  &lt;?php endif; wp_reset_query();?&gt;
  </code></pre>
  
  <p>Here <strong>args</strong> is array </p>
  
  <pre><code>Array
  (
      [paged] =&gt; 2
      [taxonomy] =&gt; product_categories
      [term] =&gt; 12-volt-power-inverters
      [post_status] =&gt; publish
      [orderby] =&gt; wpcf-watt
      [order] =&gt; ASC
  )
  </code></pre>
  
  <p><strong>[orderby] => wpcf-watt</strong></p>
  
  <p><strong>wpcf-watt</strong> is custom field which I used for the products.I used <strong>Toolset plugin</strong> for custom field in custom post product.</p>
  
  <p>Problem is product is not coming according to  <strong>[orderby] => wpcf-watt</strong> I don't know how to sort product in ascending order from database.</p>