wordpress sort posts by custom field numeric value
there is no default option in wordpress to set up sort order of post manually while adding post. Other options are sorting by title or date using query_post() function. To set up custom sort order we can do this using custom field. Use following code
REMEMBER: if you use this function then you have to assign sort_order custom field to each post. Otherwise posts which do not have sort_order custom field will not be displayed.