mardi 24 février 2015

Order for custom field after the loop


i have this table. Each post have a custom field with "region" and "city".


01 > SP > São Paulo


02 > RJ > Rio de Janeiro


03 > SP > Campinas


04 > RJ > Niteroi


This query is working perfect for show all posts in "Region = SP".



<?php

query_posts( array(
'post_type' => 'hotel',
'post_per_page' => '500',
'meta_key' => 'hotel-region',
'meta_value' => "sp")
);

?>


01 > SP > São Paulo


03 > SP > Campinas


But now i need order the query results for city A > Z. How i can change the code for this?


Thank's





Aucun commentaire:

Enregistrer un commentaire