Home › Forums › Add-ons › Flexible Content Field › Check if end of loop or next row layout's name › Reply To: Check if end of loop or next row layout's name
if you do this
$layouts = get_field('field_name', false, false);
I think that $layouts should be an array. It’s length will tell you how many layouts there are and you can set up a counter to keep track of where you are and if you’re at the end. Having the list of layouts you can also look ahead in the array to see what the next layout is.
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.