I logged in to the site to check on the issue for your because on my end the items sort as intended when I ran a quick test. See Screenshot
However when I checked your site I noticed that your Archive is resulting in a Page not found error. See Screenshot
Could you check on this for me so that I can have a look at the filters on the frontend. Currently nothing stands our to me that would point to an issue but I would need to check the filters on the frontend .
Also is this a test site where I can manipulate such as disable plugins swap themes etc?
So what I would do now is to remove these filters without all the conditionals and just test with a simple archive like I did here. hidden link
Where if it was replicable there then that would mean there is something else wrong. Given that the issue is not there then something is wrong with your archive and I would recommend stripping it down to its bare minimum.
I don't understand your answer.
You say when you do it otherwise, it works...
The problem is I need the view to work as it works now.
So wherever is the bug, there still is a bug, ain't it ?
Thank you.
I did a crosscheck of this with the order that you are experiencing and the actual order in terms of count of the items.
It is in fact being ordered correctly.
In essence the function is doing what it is meant to do. Order the terms based on their count. Now what it is NOT doing is ordering the items based on the relative page that it is on.
A proof of this can be found at the links below. hidden link
hidden link
Checking both of the Mots-cles filters on the pages you will see that the orders are the same. Essentially the relative count for the available post is different but it doesn't change the fact that the category "AFFCHER_EN_ACCORDEON" has more posts than the "NAVIGATION" category.
I understand that ordering a filter only work globally and not relatively to the page where the view is displayed.
But since both functionalities are meant to work together, in the same plugin, and they don't, I think this can be called a bug alright.
Even the displayed "count" number isn't related to the "global" count, so it seems illogic to me that the order doesn't follow the same comportment.
If bug is a too strong word, let's call this an oversight.
I have therefore suggested to edit this feature.
Thank you.