Skip to content

Instantly share code, notes, and snippets.

@eccentricpixel
Created January 31, 2014 20:54
Show Gist options
  • Save eccentricpixel/8742933 to your computer and use it in GitHub Desktop.
Save eccentricpixel/8742933 to your computer and use it in GitHub Desktop.
Here is a more full-proof way to ensure Wordpress does not throw your items out of sequence (2,24,25,3,4,5,51,6...etc). Ideally use a num field type instead of plain text.
'orderby'=>'CAST( sort_order.meta_value AS SIGNED ) DESC'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment