Home › Forums › Add-ons › Flexible Content Field › Get flexible layout field subfield outside loop › Reply To: Get flexible layout field subfield outside loop
I’ve build some page layout stuff using ACF flex fields. Honestly, I don’t think there is an “easy” way when you need the information that’s stored in the layout fields to determine html, classes or css values before you can display anything. There are really 2 choices 1) loop through the fields twice, once do determine layout and once for the data 2) loop thought the fields once and store the data to use as your building the layout. Of the 2 I would do the second only because it means not repeating myself.
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.