Forums Forums Search & Filter Pro Sort on click

Viewing 6 posts - 11 through 16 (of 16 total)
  • Anonymous
    #249338

    Hi Trevor, thanks for the suggestion. Yesterday I tried to use the select2, but I found a little bit difficult to apply css style in order to give the same look it should have (non borders around the label, but just around the dropdown select).

    However I will try again.

    Trevor
    #249342

    OK. I will wait to hear from you.

    Anonymous
    #249591

    Hi Travis, I’am working on it (excuse me the delay). First of all, following your previous link, I added to my functions.php the following script

    	  function Select2Custom(){
    	
    		if (is_page(204)){?>
    			<script>
    				(function ( $ ) {
    					$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    						$('select.sf-input-select').select2();
    					});
    				}(jQuery));
    				jQuery(document).ready(function($){
    				$('select.sf-input-select').select2();
    				});
    			</script>
    			<?php
    		}
    	  }
    	  add_action('wp_head', 'Select2Custom');

    But the select dropdown still shows a search input field which I don’t want. Secondly, the css rules I try to overwrite are not accepted. Do you have any suggestion? Thanks

    Anonymous
    #249593

    Sorry I realized I wrote the wrong script function above. The one that I actually used is

    <script>
    (function ( $ ) {
      $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
        $('select.sf-input-select').select2({minimumResultsForSearch: -1});
      });
    }(jQuery));
    jQuery(document).ready(function($){
      $('select.sf-input-select').select2({minimumResultsForSearch: -1});
    });
    </script>

    And the search input is still appearing

    Anonymous
    #249596

    Hi Travis just to say that I finally managed to customize select2 style. It took quite a bit, but I did it. You can close the ticket

    Trevor
    #249600

    Hi Elena, great to hear. My name is Trevor, not Travis. I will close this thread for now.

Viewing 6 posts - 11 through 16 (of 16 total)