Home › Forums › Add-ons › Repeater Field › Show specific rows from repeater › Reply To: Show specific rows from repeater
<?php
$count = 0;
$your_repeater = get_field('your_repeater');
if($your_repeater){
while( have_rows('your_repeater') ): the_row();
$count++;
$my_field = get_sub_field('my_field');
echo '<div class="row">'.$my_field.'</div>';
if ($count == 6) {
echo '<div class="somecontent">getcontent6</div>';
}
if ($count == 12) {
echo '<div class="somecontent">getcontent12</div>';
}
if ($count == 18) {
echo '<div class="somecontent">getcontent18</div>';
}
if ($count == 24) {
echo '<div class="somecontent">getcontent24</div>';
}
endwhile;
}
?>
with that code every 6 row your additional row with content is added
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.