{$type_name}
“;
$args = array(
‘post_type’ => ‘hotel’,
‘posts_per_page’ => -1,
‘tax_query’ => array(
array(
‘taxonomy’ => ‘city’,
‘field’ => ‘name’,
‘terms’ => $city_name
),
array(
‘taxonomy’ => ‘type’,
‘field’ => ‘name’,
‘terms’ => $type_name
)
),
‘meta_key’ => ‘hotel_name’,
‘orderby’ => ‘meta_value’,
‘order’ => ‘ASC’
);
$hotels = new WP_Query($args);
echo ‘
- ‘;
- “;
if ($official) {
echo “{$name}
“;
} else {
echo “{$name}
“;
}echo “住所:{$address}
“;
echo “電話:{$tel}
“;
if ($note) echo “備考:{$note}
“;echo “
while ($hotels->have_posts()): $hotels->the_post();
$name = get_post_meta(get_the_ID(), ‘hotel_name’, true);
$address = get_post_meta(get_the_ID(), ‘address’, true);
$tel = get_post_meta(get_the_ID(), ‘tel’, true);
$official = get_post_meta(get_the_ID(), ‘official_url’, true);
$map_url = get_post_meta(get_the_ID(), ‘map_url’, true);
$note = get_post_meta(get_the_ID(), ‘note’, true);
echo “
“;
endwhile;
echo “
“;
endforeach;
wp_reset_postdata();
?>
公開日:
