Forums › Forums › Search & Filter Pro › Sort on click
Tagged: posts sort order, V3
- This topic has 15 replies, 2 voices, and was last updated 4 years, 5 months ago by Trevor.
-
Anonymous(Private) June 18, 2020 at 12:35 pm #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.
Anonymous(Private) June 22, 2020 at 8:23 am #249591Hi 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(Private) June 22, 2020 at 8:26 am #249593Sorry 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
-
AuthorPosts