I have a registered Taxonomy called Types, which is hierarchical and works. An example of categories will be Hotel in UK --1 star --2 star --3 star Hotel in Spain --1 star --2 star --3 star etc..
I m having trouble finding the right way to display my pages (custom post Hotel).
I need the code to display hotels by taxonomy only if they exist
any help?
UPDATE CODE
$taxonomy2 = 'accomodation-type';
$termsacc = get_terms("accomodation-type",array('orderby' => 'slug', 'order' => 'ASC'));
foreach ($termsacc as $termaccomodation) {
//Here I loop through my tax acc-type
//and check if there is any post by the country $termcountry->name (getting this value higher)
$query = new WP_Query(array('post_type' => 'accomodation', 'orderby'=> $termaccomodation->name,'order' => 'DESC','accomodation-type' =>$termaccomodation->name, 'country' =>$termcountry->name,'posts_per_page' => 48 ));
and loop....