Home › Forums › Add-ons › Flexible Content Field › Show all the flexible row labels used on a page? › Reply To: Show all the flexible row labels used on a page?
You have couple of choice, but either way it will mean looping over the rows twice.
You can get the entire flex field as an array
$flex_field = get_field('content_builder');
Loop over this to create your in page navigation
You can also use the have_rows() method.
Or you can use a combination, doing it different for each. But in any case it will mean 2 loops. One to generate the navigation and another to generate the content.
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.