Add this function to your function.php file,
function orderby_custom_fields( $orderby )
{
global $wpdb;
$orderby = "$wpdb->postmeta.meta_value ASC";
remove_filter( 'posts_orderby', 'orderby_custom_fields' );
return $orderby;
}
and now add this query_post data in your file,
$args = array(
'post_type' => 'wineinput_custom',
'meta_key' => 'wine',
'showposts' => -1,
'tax_query' => array(
array(
'taxonomy' => 'categories',
'terms' => $subcategory3->term_id,
'field' => 'term_id'
)
),
);
add_filter( 'posts_orderby', 'orderby_custom_fields' );
query_posts($args);
Hope this will help you...!!