I have created a loop to order posts by an ACF number field. However it appears to be treating the number as a string instead of a number/integer. So instead of the order being: 1, 5, 7, 10, 14 it’s ordering as: 1, 10, 14, 5, 7.
I have the following:
$posts = get_posts(array(
'post_type' => 'staff',
'posts_per_page' => -1,
'meta_key' => 'stafforder',
'orderby' => 'meta_value',
'order' => 'ASC'
));
Any help would be appreciated.
Thanks in advance.
Ugh! I should have known that! Thanks so much, John.