Home › Forums › Add-ons › Flexible Content Field › Get subfield label dynamically › Reply To: Get subfield label dynamically
I also would like print out the layout label, but “get_sub_field_object” hasn’t helped me, maybe I’m using it wrong.
Made it in two ways: ACF style “has_sub_field” and also more PHP style `$fields = get_field(‘flexible’);
foreach($fields as $field)…`
Printing out flexible content field (“get_field” and “get_field_object”) gives me a large array and I can see it’s contents, but I don’t get, how [value] is related to [layouts]. Therefore I cannot get the layout label.
Could you advise me on how to get it?
Since I’m using flexible->repeater->repeater with complicated HTML, I would much more prefer “foreach” style.
Thank you 🙂
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.