Home › Forums › Front-end Issues › Display field groups in separate lists › Reply To: Display field groups in separate lists
John, thanks so much for helping out.
I’ve run the code you suggested, and you can see the results here (under the heading Optional Extras – the other two columns are coded line by line – not ideal): https://bushlapa.storiesandscience.co.za/caravans/goggas/rooimier/
Just to take a step back – what I’d like to achieve is the following:
– Display the field names and values from one field group at a time.
– Exclude any fields that do not have a value.
Here is a snippet of the printed result:
Array
(
[dry_weight] => Array
(
[ID] => 439
[key] => field_5937f37f96261
[label] => Dry weight
[name] => dry_weight
[prefix] => acf
[type] => text
[value] => 620
[menu_order] => 0
[instructions] =>
[required] => 1
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => 303
[wrapper] => Array
(
[width] => 33
[class] =>
[id] =>
)
[_name] => dry_weight
[_prepare] => 0
[_valid] => 1
[default_value] =>
[placeholder] =>
[prepend] =>
[append] => kg
[maxlength] =>
)
[total_length] => Array
(
[ID] => 440
[key] => field_5937f3b496262
[label] => Total length
[name] => total_length
[prefix] => acf
[type] => text
[value] => 3360
[menu_order] => 1
[instructions] =>
[required] => 0
[id] =>
[class] =>
[conditional_logic] => 0
[parent] => 303
[wrapper] => Array
(
[width] => 33
[class] =>
[id] =>
)
[_name] => total_length
[_prepare] => 0
[_valid] => 1
[default_value] =>
[placeholder] =>
[prepend] =>
[append] => mm
[maxlength] =>
)
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!
✨ You can now install ACF PRO with Composer, eliminating the need for third-party installers. Get the details and instructions here. https://t.co/ebEfp60Pwj
— Advanced Custom Fields (@wp_acf) February 2, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.