I have the following code below in my ~WP_Query`.
$args[ 'meta_key'] = 'price'; $args['orderby'] = 'meta_value meta_value_num'; $args['order'] = 'ASC';
The custom field in question has historic data that was created in a custom field and set as text. When I run my query I get the following results:
1,199.00, 1,299.99 169.99, 379.95.
which looks like a correct alpha sort. However, the higher numbers should appear last and the lower values first. I have tried to adjust the custom field to numeric, however I lose the custom field data.
Does anyone have a suggestion on how I should either rewrite my query or transfer my text custom field data to numeric data?