Home › Forums › Add-ons › Repeater Field › Separating last row from others › Reply To: Separating last row from others
This is where the php implode() function comes in handy. To be honest, I’m not exactly sure what your doing in your code, seems to be something missing that I need to put it all together. But here’s a short example:
if (have_rows('bike_color')) {
$colors = array();
while (have_rows('bike_color')) {
the_row();
$colors[] = get_sub_field('color');
}
echo implode(', ', $colors);
}
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.