Home › Forums › Front-end Issues › showing video on header › Reply To: showing video on header
maybe in this view is better to read the code. Thank you
i have created in ACF a Hero field a sub field called oEmbed so i have this structure:
Hero
– content
– oEmbed
– image
– other images
and the code below show only image but i need to insert also a video.
@if(!empty($hero[‘image’]))
<div class=”banner-image-wrapper”>
@if(!empty($hero[‘other_images’]))
@php
$element_classes = “swiper-slide px-0″;
@endphp
<div class=”swiper-container swiper-container-full-width mb-8”>
<div class=”swiper-wrapper “>
<div class=”{!! $element_classes !!}”>
@pic($hero[‘image’],[‘class’ => ‘ banner-image ‘])
</div>
@foreach($hero[‘other_images’] as $k => $v)
<div class=”{!! $element_classes !!}”>
@pic($v,[‘class’ => ‘ banner-image ‘])
</div>
@endforeach
</div>
<div class=”swiper-pagination”></div>
<div class=”swiper-button-prev”></div>
<div class=”swiper-button-next”></div>
</div>
@else
@pic($hero[‘image’],[‘class’ => ‘ banner-image ‘])
@endif
</div>
@else
<div class=”banner-image-wrapper”>
@pic(get_field(‘default_hero_image’,’options’),[‘class’ => ‘ banner-image ‘])
</div>
@endif
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.