Forums › Forums › Search & Filter Pro › Order post by custom taxonomy
Tagged: custom taxonomy, ORDER
- This topic has 39 replies, 3 voices, and was last updated 7 years ago by Ross.
-
Ross Moderator(Private) August 7, 2017 at 5:22 pm #124871
Hi Elena
So sorry for the delay. Ive been swamped and missed this.
I had another look and still cant see the issue.
Can you try creating a standard wp query and see if that has the same effect with sorting?
https://codex.wordpress.org/Class_Reference/WP_Query
If that doesnt work I think there still might be an issue with the encoding. I believe wp uses utf8_general_ci these days.Thanks
Trevor(Private) August 7, 2017 at 6:11 pm #124883Hi
I just did a quick and simple install of WordPress and Search & Filter with a simple EDD shop, and added your categories to the products, and then made a form, with the category sorted ascending:
https://sandfdev.cdnwebservices.net/shop/
As you can see, all works as you would expect. That means that Search & Filter gets it right. Which means that either the theme or custom code in the functions.php file, or a plugin is doing this.
Trevor(Private) August 8, 2017 at 9:17 am #124973My database was setup by the host (Cloudways) and uses MariaDB 10 (a fork of MySQL), using utf8mb4_unicode_ci as the collation.
I did try that on yours (it is not hard to change a table from within WordPress, if you know what you are doing), but it made no difference.
What you need to do is what I did in my test. Make a new WP install, add Search & Filter. Add a few posts with some test categories, set the search form up, add the widget or shortcode to a page (in my example I added the form and results shortcode to a page, it looks basic but is quick and dirty).
Anonymous(Private) August 14, 2017 at 10:21 am #125887Hi folks!
I’ve try what you told me about a new installation and didn’t work but i think i have the “problem” closer.
When i use a Post meta ACF to ordering and filter my products the order is wrong, but if i use the same terms as categories they order perfectly. So maybe is something related to the ACF fields? Your example uses categories not ACF too, isn’t it Trevor?
I can’t use categories instead of ACF fields because the initial question.
Again thank you for your help! I hope we can finally find the solution and i wont need to change all the work done 🙂
Regards.
Anonymous(Private) August 17, 2017 at 8:54 am #126346Hi Trevor!
I’ve just try the pre-release but nothing happens. Anyway i’ve discovered the problem is the “Is ACF Field?” checkbox.
If i uncheck the checkbox the order of the lateral options is correct, not yet the order of my results. Hormonales is still the first result showed before those in a category starting with A.
I’m going to debug a little more to find the problem.I appreciate if you have any update.
Thank you and regards!
Anonymous(Private) August 21, 2017 at 9:09 am #126885Thank you Trevor.
I can see the problem with the wrong ordering in the list result (not the filter words but the results posts) is a bug related with the “meta value” too.
If i show the posts without an specific order they show right (inverse alphabetically but right), but when i change to order by a meta value i created it shows me first posts that should be in the middle.
Is there any way i can follow the fixation of the bug? That way i could tell about the progression to the client who is asking from time to time.
Cheers!
-
AuthorPosts