i have a custom query, and I have a meta key that contains a sequence number: 1.1, 1.2, 2.1, 2.2… 11.1, etc
the problem occurs when the numerical sequence gets in to double digits, ie. 5.11, 5.12, 5.21
these appear as such
5.1, 5.11, 5.12, 5.2, 5.21 etc instead of 5.1, 5.2, 5.3… 5.11, 5.12 etc
how can I make them sort properly!?
$loop = new WP_Query(array(
'factsheet_category' => $term->slug,
'orderby' => 'meta_value_num',
'meta_key' => 'factsheet_id',
'order' => 'ASC'
));
You want natural order sorting,
Example;
Where as;
Solution