Answer the question
In order to leave comments, you need to log in
How can I display videos in the "Gallery" field in ACF that I myself can upload to media files?
How can I display videos in the "Gallery" field in ACF that I can upload to media files myself? So far google hasn't answered
<?php
$images = get_field('slider');
$size = 'full'; // (thumbnail, medium, large, full или произвольный размер)
if ($images) : ?>
<div class="sixth-flex">
<?php foreach ($images as $image) : ?>
<video controls="controls" poster="<?php echo $image['url']; ?>">
<source src="<?php echo $image['url']; ?>" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
Тег video не поддерживается вашим браузером.
<a href="<?php echo $image['url']; ?>">Скачайте видео</a>.
</video>
<!-- <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /> -->
<?php endforeach; ?>
</div>
<?php endif; ?>
Answer the question
In order to leave comments, you need to log in
In short, while writing, it turned out,
it's in the poster, and I insert a link to the poster in the description of the video echo $image['description'];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question