Regions and cities fit perfectly in the concept of taxonomy: a way to group things (i.e. posts). And not so much in the concept of meta data. I strongly recommend to use custom taxonomies for that instead of custom meta fields. You will gain in performance and you will have a better data relationship management. Additionally, you should stop using query_posts
and use WP_Query
instead.
That being said, if you still want to use meta fields, you can sort the query by meta value as as follow:
$args = array(
'post_type' => 'hotel',
'post_per_page' => '500',
//meta_key set for sorting only, for meta conditionals we will use meta_query parameter
//Asumming the name of the meta field is hotel-city, replace with the correct name
'meta_key' => 'hotel-city',
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'hotel-region',
'value' => 'sp'
)
)
);
$query = new WP_Query( $args );