ACF Pro – get_field image and video not working
Question
I have the following code on the homepgae but for some reason I can’t get the poster image and video src to work. Could you help me with it.
<?php $our_values = get_field('our_values'); ?>
<?php $our_values_image = get_field('video_poster_image'); ?>
<?php $our_values_video = get_field('values_video'); ?>
<?php if($our_values['values_video']): ?>
<section class="video-section">
<div class="container">
<div class="one-half">
<div class="home-intro">
<?php if($our_values['heading']): ?>
<h2 class="text-welcome"><?php echo $our_values['heading']; ?></h2>
<div class="line-rule"></div>
<?php endif; ?>
<?php echo $our_values['body_copy']; ?>
</div>
</div>
<div class="one-half">
<div class="home-video">
<video controls="controls" autoplay="false" class="video" loop="false" muted="" poster="<?php echo $our_values_image['url']; ?>">
<source id="mp4" src="<?php echo $our_values_video['url']; ?>" type="video/mp4">
</video>
</div>
</div>
</div>
</section>
<div class="clearfix"></div>
<?php endif; ?>
Ronny
0
advanced-custom-fields, images, videos
3 years
2020-07-02T22:10:27-05:00
2020-07-02T22:10:27-05:00 0 Answers
80 views
0
Leave an answer