@ebbandflow, well…im trying to get this to work with the Repeater.
At first, I had an ‘endwhile’ error – but I believe that was due to what I assume was a typo in the code above.
foreach($videos as $video): ?>
and I switched the colon to a semi-colon – and that seemed to fix the ‘endwhile’ error that I was getting.
foreach($videos as $video); ?>
Basically, the steps I did was…
— I copied and paste the code you included specifically for the Functions.php
— I then, used the recent Repeater code above on my template page where I wanted the video thumbnails to show.
— I created a Repeater field type, with the field named as: ‘video’
— Within the Repeater field type, I created a Sub Field (oEmbed) named: ‘video_url’
— The field key I am using (as mentioned in the code) is from my Repeater field type (‘video’) ex: field_544302b1vr92e
— I then go to my created post, and add a Youtube URL (as usual) within the repeater section and update the post page…
At this point, I dont get any errors – but, I also do not get any YouTube Thumbnail or videos results either…hmmm…am i missing something? :-/
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!
© 2022 Advanced Custom Fields.