コード例 #1
0
<?php

while (have_posts()) {
    the_post();
    $rooms_available = get_total_available_rooms(get_the_ID(), booking_data('date_in'), booking_data('date_out'));
    ?>
<div class="section-room bg-white animatedParent" data-sequence="500">
    <div class="container">
        <div class="room-detail">
            <div class="row">
                <div class="col-lg-9">
                    <div class="room_detail_gallery animated fadeInLeft" data-id="1">
                        <div class="slider">
                            <div class="flexslider">
                                <ul class="slides">
                                    <?php 
    while (have_rows('gallery')) {
        the_row();
        $image = get_sub_field('image')['sizes']['gallery-post-thumbnails'];
        ?>
                                    <li><img src="<?php 
        echo $image;
        ?>
" /></li>
                                    <?php 
    }
    ?>
                                </ul>
                            </div>
                        </div>
                    </div>
コード例 #2
0
ファイル: functions.php プロジェクト: sergiocasquejo/bigdream
function has_sufficient_room($data)
{
    $total_rooms_suggestion = ceil($data['no_of_adult'] / get_max_person($data['room_type_ID']));
    $no_of_rooms_available = get_total_available_rooms($data['room_type_ID'], $data['date_in'], $data['date_out']);
    if ($total_rooms_suggestion > $data['no_of_room']) {
        add_this_notices('error', 'Number of persons selected needs at least ' . $total_rooms_suggestion . ' room(s) and current available room is ' . $no_of_rooms_available . '.');
        return false;
    }
    return true;
}