- March 18, 2019 at 6:11 pm #21682
Hi! We have only one section of Grave Lots that has four-digit names, the rest are 1-3. Since we have to include letters and numbers in the Grave Lots, AJAX SEARCH PRO is performing the filter sorting as text data. I’ve added leading zeroes to get us to 3-digit numbers, but would rather not make everything 4-digit numbers just to accommodate this one section. I’m trying to find a leading special character that I can use to make a group of text data sort alphabetically between the text representation of the number 9 and the letter A. I thought a colon might work because in ASCII, that falls in between, but it sorted that before zero. If one exists, I’ll start each of those 4-digit fields with that character so the 4-digit Lots can fall in line properly in a filtered list (middle drop-diown).
http://live-mycalumetpark.pantheonsite.io/location-and-hours-grave-finder/March 19, 2019 at 10:08 am #21690
The problem is, that the taxonomy term order is is actually requested from WordPress via the get_terms(..) call. This function accepts the following ordering ‘name’, ‘slug’, ‘term_group’, ‘term_id’, ‘id’, ‘description’, ‘parent’ & ‘count’
Unfortunately the taxonomy name and slug are always considered as string based fields, and there is no option in the arguments list to typecast the name to integer values. That would not help either, as the other items would preceed the simple numerical names. So modifying the arguments in this call will not help.
Any special character, like ‘.’ dot or ‘_’ underscore are considere before the ‘0’ due to their order, but I think using a leading 0 is probably the best option here visually. I’m not sure if there is any other way.Best,
If you like my products, don't forget to rate them on codecanyon :)
March 19, 2019 at 2:05 pm #21695
OK, thank you Ernest!
You must be logged in to reply to this topic.