WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Help! Sort by decimal custom field problem.

[Resolved] Help! Sort by decimal custom field problem.

  • Hi everyone. I’m trying to make posts that have custom fields which contain numerical decimals, e.g., 234.34, 500.00, 3000.00. Now, I want to sort those posts by using a custom query_post().

    I did the meta_key=decimal&orderby=meta_value thing, but I’m having a problem because it’s sorting alphabetically. So in doing that, it is treating 500.00 to be greater than 3000.00. Is there a way for me to fix this by modifying the query? Or maybe a custom function?

    Any help will be much appreciated.

    Regards,
    Cricket

    [moderated–bump removed. Please refrain from bumping as per Forum Rules]

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Help! Sort by decimal custom field problem.’ is closed to new replies.
Skip to toolbar