Home › Forums › Add-ons › Repeater Field › repeater field with schema.org FAQPage › Reply To: repeater field with schema.org FAQPage
Your choices are
1) use a output buffer and then trim off the extra comma before output
ob_start();
// your loop that outputs content
$code = ob_get_clean();
$code = trim($code, ',');
2) Use a counter
// get # of rows
$rows = intval(get_field('repeater'));
$count = 1;
while(have_rows('repeater')) {
// output row
if ($count < $rows) {
// add a comma if there are more rows
?>,<?php
}
$count++;
}
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.