Home › Forums › ACF PRO › Different layout if 2 or more rows? › Reply To: Different layout if 2 or more rows?
Not exactly sure what you’re trying to do to be honest.
get_row_index() will only give you the current index, not the number of rows. This is good if you want to alter something based on the current row, but not if you are trying to change something based on the number of rows.
if you want to get the number of rows
$rows = count(get_field('row_content_boxes'));
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.