-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle-tour.php
224 lines (208 loc) · 10.3 KB
/
single-tour.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
<?php
/**
* The main single item template file.
*
* @package kadence
*/
namespace Kadence;
get_header();
/**
* Hook for Hero Section
*/
get_template_part( 'template-parts/entry_hero' );
?>
<section class="c-tour-details">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-12 pe-5">
<div class="c-tour-details-con">
<div class="c-featured-img">
<?php
if (has_post_thumbnail()):
the_post_thumbnail();
else:
echo '<img src="https://via.placeholder.com/750x450.jpg"
alt="placeholder" />';
endif; ?>
</div>
<?php
$description = get_the_content();
if ( !empty($description) ): ?>
<div class="c-tour-con">
<h2>Description</h2>
<?php the_content(); ?>
</div>
<?php endif; ?>
<?php
$pricing = get_field('tour_pricing');
if ( !empty($pricing) ): ?>
<div class="c-price-con">
<h2>Pricing</h2>
<?php echo $pricing; ?>
</div>
<?php endif; ?>
<?php
$day_plan = get_field('tour_day_plan');
if ( !empty($day_plan) ): ?>
<div class="c-tour-details-list">
<h2>Detailed Day Plan Itinerary</h2>
<?php echo $day_plan; ?>
</div>
<?php endif; ?>
<?php
$tour_video = get_field('tour_video');
// Use preg_match to find iframe src.
preg_match('/src="(.+?)"/', $tour_video, $matches);
$src = $matches[1];
// Add extra parameters to src and replace HTML.
$params = array(
'controls' => 0,
'hd' => 1,
'autohide' => 1
);
$new_src = add_query_arg($params, $src);
$tour_video = str_replace($src, $new_src, $tour_video);
// Add extra attributes to iframe HTML.
$attributes = 'frameborder="0"';
$tour_video = str_replace('></iframe>', ' ' . $attributes . '></iframe>', $tour_video);
if ( !empty($tour_video) ): ?>
<div class="cp-hotel-video">
<?php echo $tour_video; ?>
</div>
<?php endif; ?>
<?php
$gallery_img = get_field('tour_gallery');
if( $gallery_img ): ?>
<div class="cp-hotel-gallery">
<h2>Gallery</h2>
<div class="row">
<?php foreach( $gallery_img as $image ): ?>
<div class="col-md-4">
<div class="cp-hotel-gallery-img">
<a href="<?php echo esc_url($image['url']); ?>" class="c-gallery-list"
data-lightbox="c-gallery-list">
<img src="<?php echo esc_url($image['sizes']['medium_large']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" />
</a>
</div>
</div>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
<div class="col-lg-4 col-md-12">
<div class="c-hotel-enquery-w">
<?php
$enquire_form = get_field('company_enquire_form', 'option');
if ( !empty($enquire_form) ):
echo '<div class="c-hotel-enquery-in">';
echo do_shortcode($enquire_form);
echo '</div>';
endif;
?>
<div class="company-package-details">
<h3>Quick Info</h3>
<table class="table table-bordered">
<tbody>
<?php
if( have_rows('tour_quick_info') ): ?>
<?php
while( have_rows('tour_quick_info') ) : the_row();
$heading = get_sub_field('quick_info_heading');
$description = get_sub_field('quick_info_description');
?>
<tr class="cp-quickinfo-tr">
<td><strong><?php echo $heading; ?></strong></td>
<td><?php echo $description; ?></td>
</tr>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
</tbody>
</table>
</div>
<?php
$args = array(
'post_type' => 'tour',
'post_status' => 'publish',
'posts_per_page' => 5,
'order' => 'ASC',
);
$loop = new \WP_Query( $args );
if ( $loop->have_posts() ): ?>
<div class="othr-demostic-tour">
<h3>Beboundless Other Tours</h3>
<ul>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<li>
<div class="othr-demostic-tour-img">
<?php
if (has_post_thumbnail()):
the_post_thumbnail('thumbnail');
else:
echo '<img src="https://via.placeholder.com/150.jpg"
alt="placeholder" />';
endif; ?>
</div>
<div class="othr-demostic-tour-con">
<?php
$tour_title = get_the_title();
if (!empty($tour_title)):
echo '<h4>';
echo $tour_title;
echo '</h4>';
endif; ?>
<?php $tour_duration = get_field('tour_duration');
if (!empty($tour_duration)):
echo '<p>'.$tour_duration.'</p>';
endif; ?>
<h5><i class="fa fa-inr" aria-hidden="true"></i> 50000</h5>
</div>
<a href="#"></a>
</li>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<!-- <li>
<div class="othr-demostic-tour-img">
<img src="img/hotel-gallery-2.jpg" alt="">
</div>
<div class="othr-demostic-tour-con">
<h4>DARJEELING</h4>
<p>4 Day 3 Night</p>
<h5><i class="fa fa-inr" aria-hidden="true"></i> 50000</h5>
</div>
<a href="#"></a>
</li>
<li>
<div class="othr-demostic-tour-img">
<img src="img/hotel-gallery-3.jpg" alt="">
</div>
<div class="othr-demostic-tour-con">
<h4>Goa</h4>
<p>4 Day 3 Night</p>
<h5><i class="fa fa-inr" aria-hidden="true"></i> 50000</h5>
</div>
<a href="#"></a>
</li>
<li>
<div class="othr-demostic-tour-img">
<img src="img/hotel-gallery-4.jpg" alt="">
</div>
<div class="othr-demostic-tour-con">
<h4>KERALA</h4>
<p>4 Day 3 Night</p>
<h5><i class="fa fa-inr" aria-hidden="true"></i> 50000</h5>
</div>
<a href="#"></a>
</li> -->
</ul>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</section>
<?php get_footer(); ?>