Forums Forums Search & Filter Pro Use meta field for taxonomy value display

Viewing 7 posts - 31 through 37 (of 37 total)
  • Anonymous
    #153803

    The line you indicate has been changed as said, if I comment it I get the default “Select an option” label on the dropdown and the choice “display all” is not included in the list.

    Trevor
    #153822

    But where is that option in the sorted list?

    Anonymous
    #153828

    It doesn’t appear in the list if I comment the line.
    It appears only if I declare a label for the dropdown title (list item with value=””)

    I think the problem here lies in the ordering part of the function. The dropdown title should be given a 0 value and left out from the array of values reordered, in this way it sould always show up at the top of the list.

    But I dont’t know how to write the code to do this (should it be feasible).

    Trevor
    #153844

    Ah, if you comment the line and it then does not appear at all, we you add the value to the start of the array AFTER it has been sorted, not before.

    Anonymous
    #153869
    This reply has been marked as private.
    Trevor
    #153873

    Ah. My bad, here it is again:

    If you have commented the line out and it then does not appear at all, you could add the value to the start of the array AFTER it has been sorted, not before.

    Anonymous
    #153926

    Got it.

    
      	$orderby = "label";
    
            /* Replace array_multisort with asort + array_unshift to put the "display all" item on       
            top + asort */ 
    
            /* array_multisort($sortArray[$orderby],SORT_ASC,$input_object['options']); */  
    
           asort($sortArray[$orderby],SORT_ASC);    
               
           array_unshift($sortArray[$orderby], "Tutti gli Autori");
                
           asort($input_object['options']);
      
Viewing 7 posts - 31 through 37 (of 37 total)