I’m sorry, I don’t understand what you are trying to do. You can order posts by ID without custom fields. Set “orderby” query var in the “pre_get_posts” action to “ID”. What is the purpose of the meta box value you are trying to save? Some sort of ordering criteria? Unless it’s a numeric value to use in ordering, it doesn’t make sense to save ordering criteria like ID, date, title, etc. per post. It has to apply to all posts.
Please try to clarify, thanks.
Oh sorry! I’m trying to use the drag and drop of fields to display the same order on front-end! I was tracking the ajax post on admin and i figure out that’s saving as a meta box order on database.
Thanks for answer.
The advanced custom field meta boxes? Is the ordering saved in post_meta for the specific post by any chance? Then you can get that data with get_post_meta(). You’d have to equate whatever data is saved with the field names. (I’ve no idea what ACF is saving for ordering.) On the front end, run a loop to output all the fields, using the order data to manage what field is output when in the loop. PHP’s switch/case structure might be a good way to equate order data with field names.
Another ordering possibility would be to use CSS flex-box with the “order” property. Output the critical properties in a <style> block somewhere early on the template. The CSS that does not change with order can be added to style.css or the additional CSS panel of the customizer.