Home › Forums › ACF PRO › YouTube Thumbnail Object with oEmbed field? › Reply To: YouTube Thumbnail Object with oEmbed field?
@WPDragon i should have mentioned i just made up the markup without testing or looking at lightbox documentation — also if your using a repeater try this for testing:
<?php //For Use with Repeater Field
$videos = get_field('video');
$videos_raw = get_field('video', FALSE, FALSE);
//Add the Thubmnail to the $videos object
foreach($videos_raw as $key => $video_raw) :
$videos[$key]['video_thumb'] = get_video_thumbnail_uri($video_raw['field_5449746362c3d']);
//Replace 'field_5449746362c3d' with your field's Field key (obtainable by going to screen options in the fields admin, and setting 'Show Field Key' to 'Yes')
endforeach;
//Loop through the $videos object
foreach($videos as $video): ?>
VIDEO THUMB URL: <?php echo $video['video_thumb']; ?>
VIDEO EMBED: <?php echo $video['video_url'] ?>
<? endforeach; ?>
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.