Home › Forums › Front-end Issues › Output all ACF's in Correct Order › Reply To: Output all ACF's in Correct Order
Hey I have found a solution.
It requires a core edit of the plugin though, so I hope you might be able to implement it in the core?
$sort = array();
foreach ($value as $key => $row) {
$sort[$key] = $row['order_no'];
}
array_multisort($sort, SORT_ASC, $value);
On line 144 of api.php
On the CPT template I can then use:
$meta = get_fields( get_the_ID() );
foreach($meta as $key=>$value) {
// Stuff here
}
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.