Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Sort on click

Viewing 6 posts - 11 through 16 (of 16 total)
  • Elena Politi
    #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 Moderator
    #249342

    OK. I will wait to hear from you.

    Elena Politi
    #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

    Elena Politi
    #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

    Elena Politi
    #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 Moderator
    #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)

The topic ‘Sort on click’ is closed to new replies.