If changing the orderby parameter does nothing, that suggest something overrides it. Do you have any custom code on the site that would adjust the orderby parameter? Any plugins that deal with post ordering?
Thank-you for your reply.
I believe it is the theme, as I have not added any other custom code or plugins (the sorting worked previously, and the theme has had a couple of updates).
I contacted the theme designer and they said “both are using same function to filter and sort products. So it can not work together.” If anything it seems like the setting in Relevanssi to sort by relevance overrides the sorting function of the theme. Is there a way around this? Thanks
What does that mean? Relevanssi doesn’t “use a function to sort products”; Relevanssi reads the standard WordPress orderby parameter and uses that to sort the results.
The popularity and price sorting don’t work automatically in Relevanssi, but since you said it worked before, I assumed you already use this to enable the price and popularity sorting in Relevanssi: https://www.relevanssi.com/knowledge-base/woocommerce-popularity-and-price-sorting/. If you don’t, add that function now.
Thank-you!
Adding that into functions.php fixed the issue. When my theme was updated (to a pretty much different version) the original functions.php was re-written to work with the new theme. I think that code was left out.
Thanks again!
If you have a theme that gets updates, it’s useful to use a child theme or put your theme-independent code in a custom plugin to avoid getting overrun by a theme update.