Home › Forums › General Issues › What's the best way to get the fields in a group in order, for display? › Reply To: What's the best way to get the fields in a group in order, for display?
Since you posted that the post type is acf-field
that tells me that your using ACF5, because 4 did not use separate fields.
I’m not sure that your query will deal with nested fields, like repeaters or flexible content.
ACF does have a function you can use to get all the field objects, as well as nested field objects that will return the fields in the same format as what is output when you export a field group to PHP.
$fields = acf_get_fields($group_key);
echo '<pre>'; print_r($fields); echo '</pre>';
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.