Hello,
I have a function to display all the fields with content in a specific post:
function woo_new_product_tab_content() {
// The new tab content
$prod_id = get_the_ID();
$fields = get_fields();
if( $fields ){ ?>
<?php }
The problem is that the order that the fields appear on the page is according to the time I created the field.
I want the fields to appear according to the order on the admin panel (ordered with drag&drop), Is that possible?
Basically, no. ACF uses get_post_meta()
without a $key
and the values are returned in the order returned by this function. https://developer.wordpress.org/reference/functions/get_post_meta/
If you want them to be displayed in a specific order this is something you’ll need to deal with.
You might try get_field_objects()
https://www.advancedcustomfields.com/resources/get_field_objects/, but to be honest, I don’t know what order these are returned in. It could be the same.