WP_Query Meta_key is text value and need to sort as numeric not working
A meta_value field is always text; the fieldtype in the database structure is longtext, so unless you’re explicitly typecasting when retrieving it (i.e. $price = (float)$custom[‘price’][0]; – which won’t help with ordering in the first place), you can’t ‘adjust’ the custom field data – it’s always stored as text. Having said that, you should simply … Read more