-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
276 lines (250 loc) · 14.2 KB
/
front-page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<?php get_header(); ?>
<section class="search-form-section">
<div class="container">
<form class="search-form">
<div class="input-wrap">
<label for="where-field">WHERE</label>
<input id="where-field" class="search-form-input" type="text" placeholder="Anywhere">
</div>
<div class="input-wrap date-wrap">
<label for="check-in-field">CHECK-IN</label>
<input id="check-in-field" class="search-form-input" type="date" placeholder="dd-mm-yyyy">
</div>
<div class="input-wrap date-wrap">
<label for="check-out-field">CHECK-OUT</label>
<input id="check-out-field" class="search-form-input" type="date" placeholder="dd-mm-yyyy" value=""
min="2020-01-01" max="2030-12-31">
</div>
<div class="input-wrap guests-wrap">
<label for="guests-field">GUESTS</label>
<select id="guests-field" class="search-form-input">
<option value="" selected>GUESTS</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</div>
<div class="input-wrap btn-wrap">
<button id="search-btn" type="submit">Search</button>
</div>
</form>
</div>
</section>
<section class="hotels">
<div class="container">
<div class="hotels-head">
<h2>300+ Places to Stay</h2>
<?php
$args = array(
'post_type' => 'property',
'posts_per_page' => 2
);
$loop = new WP_Query($args);
$count_posts = $loop->found_posts; ?>
<div class="sort-wrap">
<div class="sort-count">
<select id="sort-count-select">
<option value="2" selected>2</option>
<option value="4" >4</option>
<option value="5" >5</option>
</select>
<div class="sort-count-text">Showing <span id="current-count">1-<?php echo $count_posts>2 ? 2 : $count_posts;?> </span> of <span id="all-count"><?=$count_posts?></span></div>
</div>
<div class="sort-view-wrap">
<select id="sort-filter-select">
<option value="recent" selected>Most recent</option>
<option value="price">Price</option>
<option value="flat">Flat Count</option>
</select>
<button id="grid-view" class="sort-view-btn active"><i class="fa fa-th-large" aria-hidden="true"></i></button>
<button id="list-view" class="sort-view-btn"><i class="fa fa-list-ul" aria-hidden="true"></i></button>
</div>
</div>
</div>
<div class="hotels-content">
<div class="hotel-list-wrap">
<div class="hotel-list ">
<?php if ($loop->have_posts()) {
while ($loop->have_posts()) {
$loop->the_post();
?>
<div class="hotel-item">
<a href="<?php the_permalink(); ?>" class="img-wrap">
<img src="<?=get_the_post_thumbnail_url( get_the_ID() ,'full' )?>" />
<div class="price">$<?=get_field( "price" );?> / Night</div>
</a>
<div class="info-wrap">
<a href="<?=get_field( 'location_link' );?>" class="location"><i class="fa fa-map-marker" aria-hidden="true"></i><?=get_field( "location_name" );?></a>
<div class="hotel-attributes">
<div class="attribute"><i class="fa fa-bed" aria-hidden="true"></i><span><?=get_field( "rooms" );?></span></div>
<div class="attribute"><i class="fa fa-bath" aria-hidden="true"></i><span><?=get_field( "вedrooms" );?></span></div>
<div class="attribute"><i class="fa fa-television" aria-hidden="true"></i><span><?=get_field( "bathrooms" );?></span></div>
<div class="attribute"><i class="fa fa-square-o" aria-hidden="true"></i><span><?=get_field( "square" );?></span></div>
</div>
<div class="author-wrap">
<?php
$author_id = get_the_author_meta( 'ID' );
$author_name = get_the_author_meta('user_firstname').' '.get_the_author_meta('user_lastname');;
$author_image_url = get_field('profile_avatar', 'user_'. $author_id );
?>
<img class="author-img" src="<?=$author_image_url?>" />
<div class="author-info-wrap">
<div class="name"><?=$author_name?></div>
<div class="date">Listed on <?php the_time('M d, Y'); ?></div>
</div>
</div>
<div class="action">
<a href="" class="save-btn"><i class="fa fa-star" aria-hidden="true"></i> Save</a>
<a href="<?php the_permalink(); ?>" class="details-btn">Details</a>
</div>
<div class="description"><?=get_field( "description" );?></div>
</div>
</div>
<?php }
} ?>
</div>
<?php
if ($count_posts > 2) {
$number_of_page = ceil($count_posts / 2); ?>
<div class="pagination-wrap">
<ul class="pagination">
<?php
for ($i = 1; $i <= $number_of_page; $i++) {
if ($i == 1){ ?>
<li class="active"><a href="#" data-page="<?=$i?>"><?=$i?></a></li>
<?php } else { ?>
<li><a href="" data-page="<?=$i?>"><?=$i?></a></li>
<?php }
} ?>
</ul>
</div>
<?php }
?>
</div>
<?php wp_reset_query(); ?>
<div class="hotel-filter">
<div class="filter-group">
<h3>Amenities</h3>
<div class="filter-items two-colunm">
<?php
$amenities = get_terms([
'taxonomy' => 'amenities',
'hide_empty' => false,
'orderby' => 'id',
'order' => 'ASC'
]);
foreach( $amenities as $amenitie ){
?>
<label class="container-checkbox"><?=$amenitie->name?>
<input class="filter-checkbox" data-tax="<?=$amenitie->taxonomy?>" data-tax-slug="<?=$amenitie->slug?>" type="checkbox">
<span class="checkmark"></span>
</label>
<?php } ?>
</div>
</div>
<div class="filter-group">
<h3>Extras</h3>
<div class="filter-items two-colunm">
<?php
$extras = get_terms([
'taxonomy' => 'extras',
'hide_empty' => false,
'orderby' => 'id',
'order' => 'ASC'
]);
foreach( $extras as $extra ){
?>
<label class="container-checkbox"><?=$extra->name?>
<input class="filter-checkbox" type="checkbox" data-tax="<?=$extra->taxonomy?>" data-tax-slug="<?=$extra->slug?>">
<span class="checkmark"></span>
</label>
<?php } ?>
</div>
</div>
<div class="filter-group">
<h3>Accessibility</h3>
<div class="filter-items">
<?php
$accessibility = get_terms([
'taxonomy' => 'accessibility',
'hide_empty' => false,
'orderby' => 'id',
'order' => 'ASC'
]);
foreach( $accessibility as $accessibility_item ){
?>
<label class="container-checkbox"><?=$accessibility_item->name?>
<input class="filter-checkbox" type="checkbox" data-tax="<?=$accessibility_item->taxonomy?>" data-tax-slug="<?=$accessibility_item->slug?>">
<span class="checkmark"></span>
</label>
<?php } ?>
</div>
</div>
<div class="filter-group">
<h3>Bedroom</h3>
<div class="filter-items">
<?php
$bedroom_features = get_terms([
'taxonomy' => 'bedroom-features',
'hide_empty' => false,
'orderby' => 'id',
'order' => 'ASC'
]);
foreach( $bedroom_features as $bedroom_feature ){
?>
<label class="container-checkbox"><?=$bedroom_feature->name?>
<input class="filter-checkbox" type="checkbox" data-tax="<?=$bedroom_feature->taxonomy?>" data-tax-slug="<?=$bedroom_feature->slug?>">
<span class="checkmark"></span>
</label>
<?php } ?>
</div>
</div>
<div class="filter-group">
<h3>Property Type</h3>
<div class="filter-items two-colunm">
<?php
$property_types = get_terms([
'taxonomy' => 'property-type',
'hide_empty' => false,
'orderby' => 'id',
'order' => 'ASC'
]);
foreach( $property_types as $property_type ){
?>
<label class="container-checkbox"><?=$property_type->name?>
<input class="filter-checkbox" type="checkbox" data-tax="<?=$property_type->taxonomy?>" data-tax-slug="<?=$property_type->slug?>">
<span class="checkmark"></span>
</label>
<?php } ?>
</div>
</div>
</div>
<a class="open-filter" href="javascript:void(0);">Show Filter <i class="fa fa-chevron-down" aria-hidden="true"></i></a>
</div>
</div>
</section>
<section class="download-app">
<div class="container">
<h3>Download App</h3>
<p>Fusce placerat pretium mauris, vel sollicitudin elit lacinia vitae. Quisque sit amet nisi erat.</p>
<div class="app-btn-wrap">
<a class="app-btn" href="/">
<i class="fa fa-apple" aria-hidden="true"></i>
<span class="app-btn-text-wra">
<span>Download on the</span>
<span>App Store</span>
</span>
</a>
<a class="app-btn" href="/">
<i class="fa fa-google" aria-hidden="true"></i>
<span class="app-btn-text-wra">
<span>Get it on</span>
<span>Google Play</span>
</span>
</a>
</div>
</div>
</section>
<?php get_footer(); ?>