da35d68c by Jeff Balicki

qa

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent a7fc88fe
......@@ -42,6 +42,10 @@ if ($is_preview) {
case "video": ?>
<?php
$index = get_row_index();
$iframe = get_sub_field('video');
preg_match('/src="(.+?)"/', $iframe, $matches);
$src = explode('embed/', $matches[1]);
$src = explode('?', $src[1]);
$modalId = "modal-" . $index;
?>
<div class="swiper-slide">
......@@ -50,9 +54,11 @@ if ($is_preview) {
<div class="promo-image video">
<?php
$image = get_sub_field("place_holder");
if (!empty($image)): ?>
<img src="<?php echo esc_url($image["url"]); ?>" alt="<?php echo esc_attr( $image["alt"]); ?>" loading="eager" />
<?php endif;?>
if( !empty( $image ) ): ?>
<img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" loading="eager" />
<?php else: ?>
<img src="https://img.youtube.com/vi/<?php echo $src[0];?>/mqdefault.jpg" alt="Youtube placeholder" loading="eager" />
<?php endif;?>
</div>
<div class="promo-text"><?php echo get_sub_field("title"); ?></div>
</a>
......
......@@ -43,6 +43,10 @@ $carousel_style = get_field('carousel_style');
<div class='swiper-wrapper'>
<?php while( the_repeater_field('promo_items') ): ?>
<?php $index = get_row_index();
$iframe = get_sub_field('video');
preg_match('/src="(.+?)"/', $iframe, $matches);
$src = explode('embed/', $matches[1]);
$src = explode('?', $src[1]);
$modalId = 'modal-' .$index; ?>
<div class="swiper-slide">
<div class="carousel-content">
......@@ -50,8 +54,11 @@ $carousel_style = get_field('carousel_style');
<div class="promo-image video" >
<?php $image = get_sub_field('place_holder');
if( !empty( $image ) ): ?>
<img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" loading="eager" />
<?php endif; ?>
<img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" loading="eager" />
<?php else: ?>
<img src="https://img.youtube.com/vi/<?php echo $src[0];?>/mqdefault.jpg" alt="Youtube placeholder" loading="eager" />
<?php endif;?>
</div>
<div class="promo-text"><?php echo get_sub_field('title'); ?></div>
</a>
......@@ -139,8 +146,6 @@ $carousel_style = get_field('carousel_style');
</div>
<div class="promo-text"><?php echo get_sub_field('title'); ?></div>
</a>
</div>
</div>
<?php endwhile; ?>
......