Skip Navigation

[Resolved] Sorting by number doesn’t work

This thread is resolved. Here is a description of the problem and solution.

Problem:

Sort an items results view by a numeric custom field but it doesn't arrange properly.

Solution:

The problem was a post order plugin, deactivated and sorting works well.

Relevant Documentation:

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 1.11 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 5 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1105642

I am trying to:
sort an items results view by a numeric custom field but it doesn't arrange properly.

Link to a page where the issue can be seen:
hidden link

I expected to see:
properties arranged numerically by "Operación: Venta - 545 m2", where "542" is the numeric custom field: [types field='superficie' output='raw'][/types].

Instead, I got:
when arranging ascending, i get numbers like 1568 before numbers that are less than that, like 752.

#1106431
as-a-number.JPG

Hello,

Please edit the problem view(ID 827), edit the "Sorting controls", choose option "as a number", see screenshot as-a-number.JPG.

And test again

#1106818
asdsadsadddtítulo.jpg

Hi, the sorting control is already set as a number:

[wpv-sort-orderby type="select" options="field-wpcf-superficie" label_for_field-wpcf-superficie="Field - Superficie" orderby_as_numeric_for="field-wpcf-superficie" orderby_ascending_for="field-wpcf-superficie"]
#1106930

The problem you mentioned above is abnormal, please try these:

1) In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2017, and test again

2) If the problem still persists, please provide database dump file(ZIP file) of your website, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1107703

Thanks, the problem was a post order plugin. I deactivated and sorting works well. Thanks a lot!

#1107848

You are welcome

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.