sorting - Wordpress: Sort Order by Custom Field Numerically -
How can I sort custom field data numerically that is stored as string I I will not change it in database can.
query_posts ($ query_string. 'And orderbay = meta_qua and meta_key = price and order = dex');
This is what I am using but it is classifying it as a string because it is also stored as a string.
Can anyone tell me how can I change it numerically without changing the database?
Thanks in advance.
Majhi
You can do this string meta data with a race:
If your meta value includes a dollar sign ($ 123.45), then you can cancel it by ORDER:
ORDER BY ABS (SUBSTRING (wpostmeta) .meta_value, 2)) DESC
Comments
Post a Comment