I’m pretty new to PHP, so this might not be that hard to figure out, but just thought I’d ask here. I am trying to make the repeater field break up every 2 team members by row. Right now they are all generating within the same row, which causes them to show up as a masonry layout. Is there a way to limit the amount of columns per row with the Repeater field or create this effect with bootstrap’s rows? Any leads would be much appreciated!
Here is my code so far:
// check if the repeater field has rows of data
if( have_rows('team_member') ):
// loop through the rows of data
while ( have_rows('team_member') ) : the_row(); ?>
<div class="panel panel-default">
<img src="<?php the_sub_field('team_member_image'); ?>" class="img-circle" style="width:100px;float:right;margin:0 0 10px 10px;">
<h3><?php the_sub_field('name'); ?></h3>
<p><strong><?php the_sub_field('position'); ?></strong></p>
<p><?php the_sub_field('description') ?></p>
else : ?>
<p>Please Add Team Members</p>
<?php endif; ?>
</div><!--End repeater row-->
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users