Posts show in random order

Forums › Forums › Search & Filter Pro › Posts show in random order

Viewing 6 posts – 1 through 6 (of 6 total)
  • Anonymous
    #245641

    Hi,

    I use s&f on a woocommerce store. I use as order setting: Menu order.
    I have one product set in menu order 1 and the rest of the products have the same number.
    When refreshing a category-age, all the products appear in a random order except the product with menu order ‘0’. Also when clicking to a next page in the result, it won’t show the products from that page, but also shows me products from page one again. Again in random order.

    How can I prevent this random sorting?

    Example productpage: https://cadeau.compion.dev/product-categorie/kinderkussens/

    Geert

    Ross Moderator
    #245707

    Hi Geert

    It sounds like there may be something interferring with the query, causing a random order :/

    Can you try disabling other plugins, and test on a default theme, to see if the same things happens?

    Thanks

    Anonymous
    #246219

    HI,

    Thanks for the reply.

    I have:
    + Disabled all plugins except woocommerce and S&F
    + Tried the default storefront theme and basic wp theme
    but nog results. The posts still shows me the random order through all products with the same menu=order.

    When I disable S&F, the random order stops and the products are in a fixen position every time the page refreshes. So it looks like S&F itself is causing the random order.
    When I try another post-order setting in s&f, that order is working fine and not showing post in a random order.

    Could it be that the setting for post-order: menu-order, show post with the same menu-order in a random way?

    Geert

    Ross Moderator
    #246228

    Hi Geert

    So its only when choosing menu order you get a random order?

    And the post with the position of 1 set, that is displayed consistently last / first?

    When we do a search, we don’t use many WP_Query paramaters, we do our own query, which gets a big list of Post IDs for your results, and we stuff that into a WP_Query using post__in

    Perhaps, when using menu_order, the post with position 1 is ordered correctly, but the rest are ordered according the IDs we supplied in post__in

    Does that sound like it might be correct?

    If that is the case, I suspect, setting a secondary sort order (in the posts tab of your search form) might order the remaining posts how you want?

    Let me know how that works out.

    Thanks

    Anonymous
    #246240

    Hi,

    Yes, that did the trick.
    I set the second order to ‘title’. Now all posts are on the same position after refreshing.

    Thanks for helping!
    Geert

    This ticket can be closed.

    Ross Moderator
    #246241

    Great stuff

Viewing 6 posts – 1 through 6 (of 6 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.