Home › Forums › Add-ons › Repeater Field › Grid based layout and repeater help needed › Reply To: Grid based layout and repeater help needed
Hi James,
I solved it with a little tweak to your code, thanks for getting me pretty much there!
<?php if( have_rows('factsheets') ): ?>
<div class="vc_row wpb_row vc_row-fluid dt-default" style="margin-top: 0px; margin-bottom: 0px; min-height: 0px;">
<?php while( have_rows('factsheets') ): the_row();
// vars
$factsheet_title = get_sub_field('factsheet_title');
$factsheet_pdf = get_sub_field('factsheet_pdf');
?>
<div class="wpb_column vc_column_container vc_col-sm-3">
<div class="vc_column-inner ">
<div class="wpb_wrapper">
<a href="<?php echo $factsheet_pdf['url']; ?>"><img src="/pdf-logo.png" /></a>
<span><?php echo $factsheet_title; ?></span>
</div>
</div>
</div>
<?php
if( get_row_index() % 4 == 0 ){
// Close the div and open it again
echo '</div><div class="vc_row wpb_row vc_row-fluid dt-default" style="margin-top: 0px; margin-bottom: 0px; min-height: 0px;">';
}
?>
<?php endwhile; ?>
</div>
<?php endif; ?>
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.