Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Buttons to filter results by year
This topic contains 14 replies, has 2 voices, and was last updated by Ernest Marcinko 10 months, 3 weeks ago.
- AuthorPosts
- April 20, 2022 at 10:48 am #37575
Hi, we’d like to know if it’s possible to have buttons to filter the search results by year e.g. 2022, 2021, 2020, etc.
April 20, 2022 at 5:02 pm #37600Hi,
I’m afraid that type of layout is not possible. You can do drop-down or checkboxes or radio buttons.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 21, 2022 at 1:53 pm #37619May we ask how do we have radio buttons to filter by year? i.e. selecting 2021 will show only posts from 2021. We only see the date filter with the date picker selection. And can we have both, radio buttons plus date picker at the same time?
April 22, 2022 at 8:50 am #37621Oh, I’m sorry, I was thinking it was a custom field type filter with only containing the year. For datetime/timestamp values, or post date filters only the date picker is available, I’m sorry.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 26, 2022 at 3:05 pm #37651There’s another question concerning the datepicker. When it loads, the year dropdown shows 1999 to 2019. How can we make it show up to 2022?
April 26, 2022 at 3:22 pm #37652You cannot access this content.April 26, 2022 at 7:42 pm #37653Hi, we found that it’s related to the setting “Minimal character count to trigger search”. When it’s less than the minimal character, it won’t do anything after filtering by date. We have the following code to trigger search by enter.
(function($){ $('input.orig').on('keyup', function(e){ if (e.which == 13) { ASP.api(1, 1, 'searchFor', $(this).val()); } }); }(WPD.dom));
How do we make datepicker trigger search even when it’s less than the minimal character?
April 27, 2022 at 1:42 pm #37655Hi,
Well, that is intentional behaviour, you can maybe try this on the datepicker:
Best,(function($){ $('.asp_datepicker').on('change', function(e){ ASP.api(1, 1, 'searchFor'); }); }(WPD.dom));
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 28, 2022 at 3:29 am #37661May I ask if it’s possible to customize the datepicker or use something like https://www.daterangepicker.com/?
April 28, 2022 at 4:09 am #37662We also have another question. Is it possible to have the Reset button in filters to only reset the filers but not search field, because it’ll show “no results” when I click reset.
April 28, 2022 at 1:51 pm #37671I’m afraid that may not be possible. However you can change the Reset button settings not to trigger the search afterwards, only to reset everything.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 28, 2022 at 2:05 pm #37672how do we make reset not to trigger search?
April 28, 2022 at 2:21 pm #37673This setting.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 2, 2022 at 7:21 am #37681Unfortunately, we already set to do nothing but it seems it’ll still trigger a search then shows no results on mobile.
May 2, 2022 at 3:40 pm #37690Can you please make sure to clear the mobile device browser cache?
I tired two different mobile devices just now, and they seemed to work okay. The reset did not trigger the search after pressing. Thank you!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.