Home › Forums › Add-ons › Repeater Field › Loops files with URL › Reply To: Loops files with URL
I just did the same thing, below is how I did it. Since Elliot added the have_rows function in 4.3 (http://www.advancedcustomfields.com/resources/functions/have_rows/) it’s much easier to get it to work. My code might not be optimal (been up too long…), but it works.
<?php
$rows = get_field('reaction_videos');
if($rows) {
echo '<h3 class="reaction">Reaction Videos</h3>';
echo '<ul>';
while(the_sub_field('reaction_videos')) {
$video = the_sub_field('reaction_video');
$desc = the_sub_field('reaction_video_desc');
echo '<li><a href="' . $video . '" title="' . $desc . '" class="lightbox" rel="foobox">' . $desc . '</a></li>' ;
}
}
?>
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.