Forums Forums Search & Filter Pro Numerical sorting not as should be

Tagged: ,

Viewing 10 posts - 1 through 10 (of 14 total)
  • Anonymous
    #64736

    Hi,

    On http://roulette-masters.com/search-filter/ the filter by Review Score (added through Advanced Custom Fields plugin) doesn’t go as it should.

    In the settings tab I made the default order as Meta Value (descending) and the Meta key as review_score (numerical). It does order by default, but not the way it should be. The 10 is the highest, but then 9,0 to 9,9 are completely random. Followed by 8,0 to 8,9 completely random.

    Strangest thing is that the manually implemented sorting order DOES work. In the sidebar I left the manual sort order to show the way it should be sorted.

    I hope you can help me set the default order as it is with the manual sorting order.
    Hope to hear from you soon.

    Kind regards,

    Victor

    Anonymous
    #64738
    This reply has been marked as private.
    Trevor
    #64781

    By using 999 results per page, did you need infinite? In wordpress this is often achieved with the value -1 😉

    I am looking at the form now, but it seems to be set as a range slider?

    Maybe I misunderstood the question (entirely possible).

    Anonymous
    #64785
    This reply has been marked as private.
    Trevor
    #64829

    Hi Victor, from what I can see, this seems like something is overriding the sort order, and basing it on something else (another field). Now, you know the data far better than me. Can you see what that sort order is? Alphabetical by Title, by date published ….

    Anonymous
    #64846

    Hi,

    Blog posts are sorted by date. The way it seems now is that everything from 9.0 to 9.9 is sorted by date, then 8.0 to 8.9 and so on.
    Strange thing remains that the sorting order through the frontend dropdown does work, but not if I select it as default sort order.

    Trevor
    #64856

    As I suspected. This means that there is some code in your theme that is over-riding our filter. Probably a pre_get_posts() or similar. You need to look for this (might be in the functions.php file, or might be in a template, or a plugin). Or you need to find the wp_query and see if it is being done there.

    Anonymous
    #67495

    The functions.php is not so big, so I found out quick that there is no pre_get_posts().
    Also, I couldn’t find a plugin that is interfering with the sorting order.
    Any idea where to look?

    Trevor
    #67506

    It must be in the theme files somewhere. Or …. I think I need to speak with the developer, Ross, about this. I will be back to you when I have spoken to him, but there may be a delay.

    Trevor
    #72093
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 14 total)