Sorting a custom column that contains color (ColorPicker)
-
Hi,
I have a custom column for a custom post type that I created by using the color picker and now contains the hex of one of 6 colors: red, dark-orange, light-orange, yellow, dark-green, light-green.
I added this column to the list of sortable columns and set it to be sorted by using meta_value and not meta_value_num and now it works sort-of OK…
The order they are sorted is different than what I want it to be. Currently, it’s light-green, dark-green, red, dark-orange, light-orange. I want it to be sorted in the order I listed them above (red, dark-orange, light-orange, yellow, dark-green, light-green).
Any ideas on how to achieve this?
Thanks,
Yuval.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Sorting a custom column that contains color (ColorPicker)’ is closed to new replies.