Are you using get_post_custom
to get post meta? Because from what you said, it looks like you display fields in the backend in one order and display fields in the frontend in another order, and as we don't have a function to list all fields in the frontend, the only way to do that I guess is get_post_custom
function.
If so, I'm afraid there's no way to achieve that. The order you register fields = the order fields are displayed in the backend = the order WP processes data and stores in the DB = the order you get with get_post_custom
.
Or maybe you should do something like array_reverse
as a trick before displaying fields in the frontend?