Home › Forums › ACF PRO › Create columns Front-End › Reply To: Create columns Front-End
Hi @pepacobos
I believe you are talking about the front end, right? Could you please share your code so I can create a modification from it?
If you use the basic loop, I think you can set the class to the first column like this:
// check if the repeater field has rows of data
if( have_rows('repeater_field_name') ):
// loop through the rows of data
while ( have_rows('repeater_field_name') ) : the_row();
// display a sub field value
?>
<div class="first"><?php the_sub_field('sub_field_name_1'); ?></div>
<div><?php the_sub_field('sub_field_name_2'); ?></div>
<div><?php the_sub_field('sub_field_name_3'); ?></div>
<div><?php the_sub_field('sub_field_name_4'); ?></div>
<?php
endwhile;
else :
// no rows found
endif;
I hope this helps 🙂
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.