-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
352 lines (272 loc) · 10.8 KB
/
home.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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
<?php
/**
* Template name:Home
*/
get_header();?>
<?php
$homesections = get_posts(array(
'numberposts' => -1,
'post_type' => 'homesection',
'orderby' => 'menu_order',
'order' => 'ASC',
));
echo do_shortcode( '[rev_slider alias="home"]' );
?>
<?php
$event = pmwoodwind_get_featured_event();
if ( $event ) : ?>
<div id="featured-event">
<?php echo get_the_post_thumbnail( $event->ID, 'full' ); ?>
<h3><?php echo get_the_title( $event->ID ); ?></h3>
<?php if ( ! in_array( $event->post_type, array(
'product',
'page'
) ) ) :
$date_format = get_option( 'date_format', 'F j, Y' );
$time_format = get_option( 'time_format', 'g:i a' );
$start_datetime = strtotime( get_post_meta( $event->ID, '_EventStartDate', true ) );
if ( function_exists( 'tribe_get_option' ) ) : ?>
<p class="event-start-date"><?php echo date( $date_format, $start_datetime ) . tribe_get_option( 'dateTimeSeparator', ' @ ' ) . date( $time_format, $start_datetime ); ?></p>
<?php endif;
$organizers = array();
if ( function_exists( 'tribe_get_organizer_ids' ) ) {
$organizers = tribe_get_organizer_ids( $event->ID );
}
$organizer = false;
if ( is_array( $organizers ) &&
isset( $organizers[0] ) &&
$organizers[0] ) {
$organizer = $organizers[0];
}
if ( function_exists( 'tribe_get_organizer_phone' ) ) : ?>
<p class="event-organizer-phone"><?php echo 'for reservations call ' . tribe_get_organizer_phone( $organizer ); ?></p>
<?php endif;
else :
echo apply_filters( 'the_content', get_post_meta( $event->ID, '_rbm_featured_text', true ) );
endif; ?>
<a href="<?php echo get_permalink( $event->ID ); ?>" class="btn">
<?php if ( ! in_array( $event->post_type, array(
'product',
'page'
) ) ) : ?>
Event Details
<?php else : ?>
Details
<?php endif; ?>
</a>
</div>
<?php endif; ?>
</div>
<div class="fullbg">
<!-- New Releases -->
<div id="new-releases" class="new-releases article container">
<div class="row">
<div class="col-md-12 info" style="text-align:center;">
<?php
// Start the loop.
while ( have_posts() ) : the_post();
// Include the page content template.
the_content();
endwhile;
?>
</div>
</div>
</div>
</div>
<?php foreach($homesections as $homesection):
$sectionproducts = get_post_meta($homesection->ID,'_section_product',true);
$sectionorder = get_post_meta($homesection->ID,'_section_order',true);
$order = explode(',',$sectionorder);
?>
<div class="homesection">
<div class="category-head">
<h4><?php echo $homesection->post_title;?></h4>
<div class="bars-animation">
<img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/hicon.png" alt="PM">
</div>
<p><?php echo $homesection->post_content;?><p>
</div>
<div id="gallery" class="gallery-home clearfix">
<?php
foreach($sectionproducts as $i=>$sectionproduct):
$image = $order[$i];
$gallery_images = explode( ',', get_post_meta( $sectionproduct, '_product_image_gallery', true ) );
$types = wp_get_post_terms($sectionproduct, 'product_cat');
foreach($types as $type){
if($type->parent == 0){
$main = $type->term_id;
}
}
foreach($types as $type){
if($type->parent == $main){
$lastcat = $type;
}
}
?>
<a href="<?php echo get_term_link( $lastcat->term_id, 'product_cat' ); ?>">
<?php echo wp_get_attachment_image( $gallery_images[ $image - 1 ], 'home_grid', false, array( 'class' => 'img-responsive' ) ); ?>
<p><?php echo $lastcat->name;?></p>
</a>
<?php endforeach;?>
</div>
</div>
<?php endforeach;?>
<div id="latest-work" class="latest-work container hover-section">
<div class="category-head">
<h4>Accessories</h4>
<div class="bars-animation">
<img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/hicon.png" alt="PM">
</div>
<p><?php echo get_post_meta(2,'wpcf-accesories',true);?></p>
</div><!-- Category Head -->
<div class="row">
<div class="col-sm-3">
<div class="album">
<a class="case" href="/products/accessories?_accessory_categories=reeds&_show=new">
<div class="disk-wrapper">
<img src="<?php echo THEME_URL; ?>/dist/assets/img/albums/disk.png" alt="Disk">
</div>
<div class="case-wrapper">
<img src="<?php echo THEME_URL; ?>/dist/assets/img/albums/case.png" alt="Case">
</div>
<img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/reeds.png" alt="Cover" class="img-responsive cover">
</a>
<h5>D’Addario Select Jazz Unfiled Alto Saxophone Reeds (<a href="/products/accessories?_accessory_categories=reeds&_show=new">Reeds</a>)</h5>
</div>
</div>
<div class="col-sm-3">
<div class="album">
<a class="case" href="/products/accessories/?_accessory_categories=ligatures&_show=new">
<div class="disk-wrapper">
<img src="<?php echo THEME_URL; ?>/dist/assets/img/albums/disk.png" alt="Disk">
</div>
<div class="case-wrapper">
<img src="<?php echo THEME_URL; ?>/dist/assets/img/albums/case.png" alt="Case">
</div>
<img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/ligatures.png" alt="Cover" class="img-responsive cover">
</a>
<h5>Rovner Platinum Ligature (<a href="/products/accessories/?_accessory_categories=ligatures&_show=new">Ligatures</a>)</h5>
</div>
</div>
<div class="col-sm-3">
<div class="album">
<a class="case" href="/products/accessories?_accessory_categories=stands&_show=new">
<div class="disk-wrapper">
<img src="<?php echo THEME_URL; ?>/dist/assets/img/albums/disk.png" alt="Disk">
</div>
<div class="case-wrapper">
<img src="<?php echo THEME_URL; ?>/dist/assets/img/albums/case.png" alt="Case">
</div>
<img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/stands.png" alt="Cover" class="img-responsive cover">
</a>
<h5>Hercules Alto/Tenor Stand (<a href="/products/accessories?_accessory_categories=stands&_show=new">Stands</a>)</h5>
</div>
</div>
<div class="col-sm-3">
<div class="album">
<a class="case" href="/products/accessories?_accessory_categories=cases&_show=new">
<div class="disk-wrapper">
<img src="<?php echo THEME_URL; ?>/dist/assets/img/albums/disk.png" alt="Disk">
</div>
<div class="case-wrapper">
<img src="<?php echo THEME_URL; ?>/dist/assets/img/albums/case.png" alt="Case">
</div>
<img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/hiscox.jpg" alt="Cover" class="img-responsive cover">
</a>
<h5>Hiscox Case (<a href="/products/accessories?_accessory_categories=cases&_show=new">Cases</a>)</h5>
</div>
</div>
</div>
<p style="margin:50px;text-align:center;"><a href="/products/accessories/?_show=new" class="btnbluebig">Browse Accessories by Category</a></p>
</div>
<!-- Tour Dates -->
<!-- Gallery -->
<!-- About -->
<!-- Twitter Feed -->
<div class="twitter-feed parallaxBG">
<div class="container">
<!-- Here will be added automatically the tweet -->
<div id="tweet-example-1"><h3 style="color: #fff;text-align: center;">Please feel free to ask questions<br> about any of the used instruments or repair.</h3>
<p style="text-align: center;"><a href="/contact" style="background:#ffffff;color:#000000;" class="btn">Send us a message</a></p>
</div>
</div>
</div>
<div id="blog" class="blog-home container hover-section">
<div class="category-head">
<h4>Testimonials</h4>
<div class="bars-animation">
<img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/hicon.png" alt="PM">
</div>
<p>Our Partners Testimonials. </p>
</div>
<div id="trd-testimonial" class="trd-testimonial row">
<?php
$posts = get_posts(array(
'numberposts' => 6,
'post_type' => 'clients',
'meta_key' => 'wpcf-show-in-home',
'meta_value' => 'yes',
'orderby' => 'menu_order',
'order' => 'ASC',
));
foreach($posts as $post):?>
<div class="trd-testimonial-slides col-sm-12 col-md-3">
<div class="trd-testimonial-text closed">
<div class="testimonial-content closed">
<p><?php echo get_post_meta($post->ID, 'wpcf-testimonial', true);?></p>
<div class="read-more-container text-center">
<a class="secondary btn" href="#">
Read More
</a>
</div>
</div>
</div>
<div class="trd-satisfied-user-info">
<div class="trd-user-img-wrapper">
<?php if ( ! get_post_meta( $post->ID, 'wpcf-image', true ) ) : ?>
<?php echo wc_placeholder_img( 'thumbnail' ); ?>
<?php else :
$dir = wp_upload_dir();
$attachment_id = pmwoodwind_media_file_exists( str_replace( trailingslashit( $dir['baseurl'] ), '', get_post_meta( get_the_ID(), 'wpcf-image', true ) ) );
echo wp_get_attachment_image( $attachment_id, 'thumbnail' );
endif; ?>
</div>
<h3>
<?php
$website_url = get_post_meta($post->ID, 'wpcf-link', true);
if ( $website_url ) : ?>
<a href="<?php echo get_post_meta($post->ID, 'wpcf-link', true);?>" target="_blank">
<?php endif; ?>
<?php echo $post->post_title;?>
<?php if ( $website_url ) : ?>
</a>
<?php endif; ?>
</h3>
</div>
</div>
<?php endforeach;?>
</div>
</div>
<div class="brand-home">
<div class="container">
<div class="item">
<a href="http://www.selmer.fr" target="_blank"><img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/selmer.jpg" alt="selmer"></a>
</div>
<div class="item">
<a href="https://www.yamaha.com/en/" target="_blank"><img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/yamaha.jpg" alt="yamaha"></a>
</div>
<div class="item">
<a href="http://www.yanagisawasax.co.jp/en/ " target="_blank"><img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/yanagisawa.jpg" alt="yanagisawa"></a>
</div>
<div class="item">
<a href="http://www.julius-keilwerth.com/en/" target="_blank"><img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/keilwerth.jpg" alt="keilwerth"></a>
</div>
<div class="item">
<a href="http://www.pmauriatmusic.com" target="_blank"><img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/pmauriat.jpg" alt="pmauriat"></a>
</div>
<div class="item">
<a href="http://www.buffet-crampon.com/en/" target="_blank"><img src="<?php echo THEME_URL; ?>/dist/assets/img/elements/buffet.jpg" alt="buffet"></a>
</div>
</div>
</div>
<?php get_footer();?>