Home › Forums › ACF PRO › Getting just the url that was entered into an oEmbed field inside a variable › Reply To: Getting just the url that was entered into an oEmbed field inside a variable
I can’t seem to make this work with my repeater. Here’s my code:
if(have_rows('videos')): while(have_rows('videos')): the_row();
$video_embed_url = get_sub_field('video_embed', false, false);
$thumbnail = get_sub_field('thumbnail');
$thumbnail_url = $thumbnail['url'];
echo '<a href="' . $video_embed_url . '"><img src="' . $thumbnail_url . '" /></a>';
endwhile; endif;
It’s outputting the whole iframe embed code, not the URL entered into the oEmbed field. Also, nothing changes if I remove ‘false, false’ from that get_sub_field.
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.