As you already know an archive page basically shows a lists of all posts or custom post types (depending on whether it’s the archive.php file or an archive-cpt_name.php file). By default the archive page will sort your posts by title in alphabetical order.

If you want an archive page to sort posts by a custom field value instead simply use the following code right before the loop.

Now on line 2 insert the Field Name of the custom field you would like to sort the list by. Thats it!