qa
Signed-off-by: Jeff <jeff@gotenzing.com>
Showing
2 changed files
with
18 additions
and
7 deletions
| ... | @@ -42,6 +42,10 @@ if ($is_preview) { | ... | @@ -42,6 +42,10 @@ if ($is_preview) { |
| 42 | case "video": ?> | 42 | case "video": ?> |
| 43 | <?php | 43 | <?php |
| 44 | $index = get_row_index(); | 44 | $index = get_row_index(); |
| 45 | $iframe = get_sub_field('video'); | ||
| 46 | preg_match('/src="(.+?)"/', $iframe, $matches); | ||
| 47 | $src = explode('embed/', $matches[1]); | ||
| 48 | $src = explode('?', $src[1]); | ||
| 45 | $modalId = "modal-" . $index; | 49 | $modalId = "modal-" . $index; |
| 46 | ?> | 50 | ?> |
| 47 | <div class="swiper-slide"> | 51 | <div class="swiper-slide"> |
| ... | @@ -50,9 +54,11 @@ if ($is_preview) { | ... | @@ -50,9 +54,11 @@ if ($is_preview) { |
| 50 | <div class="promo-image video"> | 54 | <div class="promo-image video"> |
| 51 | <?php | 55 | <?php |
| 52 | $image = get_sub_field("place_holder"); | 56 | $image = get_sub_field("place_holder"); |
| 53 | if (!empty($image)): ?> | 57 | if( !empty( $image ) ): ?> |
| 54 | <img src="<?php echo esc_url($image["url"]); ?>" alt="<?php echo esc_attr( $image["alt"]); ?>" loading="eager" /> | 58 | <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" loading="eager" /> |
| 55 | <?php endif;?> | 59 | <?php else: ?> |
| 60 | <img src="https://img.youtube.com/vi/<?php echo $src[0];?>/mqdefault.jpg" alt="Youtube placeholder" loading="eager" /> | ||
| 61 | <?php endif;?> | ||
| 56 | </div> | 62 | </div> |
| 57 | <div class="promo-text"><?php echo get_sub_field("title"); ?></div> | 63 | <div class="promo-text"><?php echo get_sub_field("title"); ?></div> |
| 58 | </a> | 64 | </a> | ... | ... |
| ... | @@ -43,6 +43,10 @@ $carousel_style = get_field('carousel_style'); | ... | @@ -43,6 +43,10 @@ $carousel_style = get_field('carousel_style'); |
| 43 | <div class='swiper-wrapper'> | 43 | <div class='swiper-wrapper'> |
| 44 | <?php while( the_repeater_field('promo_items') ): ?> | 44 | <?php while( the_repeater_field('promo_items') ): ?> |
| 45 | <?php $index = get_row_index(); | 45 | <?php $index = get_row_index(); |
| 46 | $iframe = get_sub_field('video'); | ||
| 47 | preg_match('/src="(.+?)"/', $iframe, $matches); | ||
| 48 | $src = explode('embed/', $matches[1]); | ||
| 49 | $src = explode('?', $src[1]); | ||
| 46 | $modalId = 'modal-' .$index; ?> | 50 | $modalId = 'modal-' .$index; ?> |
| 47 | <div class="swiper-slide"> | 51 | <div class="swiper-slide"> |
| 48 | <div class="carousel-content"> | 52 | <div class="carousel-content"> |
| ... | @@ -50,8 +54,11 @@ $carousel_style = get_field('carousel_style'); | ... | @@ -50,8 +54,11 @@ $carousel_style = get_field('carousel_style'); |
| 50 | <div class="promo-image video" > | 54 | <div class="promo-image video" > |
| 51 | <?php $image = get_sub_field('place_holder'); | 55 | <?php $image = get_sub_field('place_holder'); |
| 52 | if( !empty( $image ) ): ?> | 56 | if( !empty( $image ) ): ?> |
| 53 | <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" loading="eager" /> | 57 | <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" loading="eager" /> |
| 54 | <?php endif; ?> | 58 | |
| 59 | <?php else: ?> | ||
| 60 | <img src="https://img.youtube.com/vi/<?php echo $src[0];?>/mqdefault.jpg" alt="Youtube placeholder" loading="eager" /> | ||
| 61 | <?php endif;?> | ||
| 55 | </div> | 62 | </div> |
| 56 | <div class="promo-text"><?php echo get_sub_field('title'); ?></div> | 63 | <div class="promo-text"><?php echo get_sub_field('title'); ?></div> |
| 57 | </a> | 64 | </a> |
| ... | @@ -139,8 +146,6 @@ $carousel_style = get_field('carousel_style'); | ... | @@ -139,8 +146,6 @@ $carousel_style = get_field('carousel_style'); |
| 139 | </div> | 146 | </div> |
| 140 | <div class="promo-text"><?php echo get_sub_field('title'); ?></div> | 147 | <div class="promo-text"><?php echo get_sub_field('title'); ?></div> |
| 141 | </a> | 148 | </a> |
| 142 | |||
| 143 | |||
| 144 | </div> | 149 | </div> |
| 145 | </div> | 150 | </div> |
| 146 | <?php endwhile; ?> | 151 | <?php endwhile; ?> | ... | ... |
-
Please register or sign in to post a comment