Forums › Forums › Search & Filter Pro › Taxonomy to Meta key
- This topic has 9 replies, 2 voices, and was last updated 4 years, 1 month ago by Trevor.
-
Anonymous(Private) September 15, 2020 at 8:55 pm #259556
Hi!
I made a taxonomy with CPT UI and I can see it on my Search form page. However, I want the taxonomy to be only in the sorting option, not for visitors to see in the front end. So I assumed the taxonomy to appear to Sort options -> Meta value -> Meta key, but didn’t. So what am I missing to get this to work?
Trevor(Private) September 16, 2020 at 10:15 am #259602If data terms are stored as a taxonomy, they cannot be sorted, as taxonomy data are stored as serialized data (multiple terms, like an array) per post (which term in the array would you sort by?). Even if only one term per post is used, WordPress still stores them like this.
Make a custom field and allocate a value you can sort by, but, be warned, if a post does not have a value in this field, then it will not appear at all in the results if you use the field to order by. Custom fields can store data as single values or serialized data, so those set to store the data as single values can be sorted.
Anonymous(Private) September 16, 2020 at 8:47 pm #259809Hi,
Thanks for you message. I managed to insert additional information with ACF. I made a test with three values (1100, 387 and 3620) and I managed to short them wrongly at my site. They go by the first number to an order, not by the actual number “size”. As in, I wish to short them from smallest to biggest (387, 1000, 3620) but the result is 1100, 387 and 3620. So how to fix this?
-
AuthorPosts