Home › Forums › Add-ons › Repeater Field › Repeater Help
I am using a repeater from ACF to allow easily editable content. I then display the information put into the repeater like so :
IMG | Content
Content | IMG
IMG | Content
I now no longer need an image in the second row, so i need second row of content in the repeater to show the content to be a large-12 cell. I have this code but i’m unsure of how to adapt it so it outputs like
IMG | Content
Content |
IMG | Content
Any help is massively appreciated.
<div class="grid-x grid-margin-x grid-padding-x">
<?php $i=0 ; if(get_field( 'biography_repeater')):
while(has_sub_field( 'biography_repeater')): $i++;
$image=get_sub_field( 'biog_img');?>
<div class="grid-x grid-margin-x grid-padding-x">
<!-- right column -->
<div class="large-6 cell biog-card">
<?php if (($i % 2)==0 ): ?>
<h2>
<?php the_sub_field( 'biog_title'); ?>
</h2>
<hr />
<p>
<?php the_sub_field( 'biog_desc'); ?>
</p>
<?php else: ?>
<img src="<?php echo $image['url']; ?>" />
<?php endif; ?>
</div>
<div class="large-6 cell biog-card">
<?php if (($i % 2)==0 ): ?>
<img src="<?php echo $image['url']; ?>" />
<?php else: ?>
<h2 style="text-align:right;">
<?php the_sub_field( 'biog_title'); ?>
</h2>
<hr />
<p style="text-align:right;">
<?php the_sub_field( 'biog_desc'); ?>
</p>
<?php endif; ?>
</div>
<!-- right column -->
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
The topic ‘Repeater Help’ is closed to new replies.
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.