Home › Forums › Add-ons › Repeater Field › Need to show two Sub Fields on each div › Reply To: Need to show two Sub Fields on each div
<?php
if (have_rows('testimonials-int')) {
$count = 0;
?>
<div class="row">
<?php
while(have_rows('testimonials-int')) {
$count++;
if ($count > 2) {
break;
}
the_row();
$image = get_sub_field('avatar-int');
$content = get_sub_field('content-int');
$name = get_sub_field('name-int');
?>
<div class="medium-6 columns wrapper">
<img src="<?php echo $image; ?>" alt="Testimonials" />
<?php echo $content; ?>
<span><?php echo $name; ?></span>
</div>
<?php
}
?>
</div>
<?php
}
?>
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.