Trying to find a taxonomy term leading character between 9 and A.

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Trying to find a taxonomy term leading character between 9 and A.

This topic contains 2 replies, has 2 voices, and was last updated by PepperGroup PepperGroup 5 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #21682
    PepperGroup
    PepperGroup
    Participant

    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/

    #21690
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    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,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #21695
    PepperGroup
    PepperGroup
    Participant

    OK, thank you Ernest!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.