Sort by meta_value_num
-
I love this plugin. Thank you for making it. It has made my website very data-driven and much, much more automatic than what I usually deal with. I enter one post and now I can have data from that post in multiple places. Our use case is this: we’re a law firm, and we post our case results on the Case Results page, the Attorney’s info page (for the attorneys on that case), and the Practice Area page (for the related practice area). I enter create the case result using a custom post type that integrates Advanced Custom Fields. One of the custom fields is “hidden_value” where I type a numeric value of the case.
When I try and order by this hidden_value, it sorts alphabetically. 90,000 is above 40,000,000 because 9 comes first (in descending order).
I’ve made it work by modifying a few things in the plugin manually:
Changed references to “meta_value” to “meta_value_num” in the main plugin file.
Changed same reference in wp_options here: s:14:”meta_value_num”This works for what I want it to do. But when the plugin gets updated, I have to manually tweak it again.
Is there any way this can be updated to add another Order By that is “Custom Field (Num)”?
I would be eternally grateful.
Thanks.
- The topic ‘Sort by meta_value_num’ is closed to new replies.