Home › Forums › Add-ons › Repeater Field › ACF Repeater max 6 items display inside table › Reply To: ACF Repeater max 6 items display inside table
You’re not going to be able to do this without some extremely complex coding.
Is there a reason that you’re using a table?
If a table is the only way you can do this then I would suggest putting each row of the repeater into html and then output that html in the order you want based on the number of rows.
$row_html = array();
while(have_rows('repeater')) {
the_row();
$index = get_row_index();
$row_html[$index] = '<div>';
$row_html[$index] .= get_sub_field('my_sub_field');
$row_html[$index] .= '</div>';
}
You’ll still need some creative logic, but at least you won’t be trying to do it inside of the loop.
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.