Forums › Forums › Search & Filter Pro › Need help with sorting of results on results page
Tagged: sort
- This topic has 8 replies, 2 voices, and was last updated 4 years ago by Trevor.
-
Anonymous(Private) November 18, 2020 at 11:37 am #266916
Hi Team,
Greetings !I would like to get help in sorting the results which shows on results page. i mean i have uploaded logos and i want to sort them in alphabetical order in frontend. which means in the backend, user can upload any logo in any order but they should be sorted in frontend.
for this we have to edit wp_query, so do let me know how can i customize the query .
Here is the page where i need to sort the results : http://evc.thewebchef.co/investments/
currently you would see that the logos are already sorted but i have done them manually with another plugin but i want to actually customize the query because i will be uploading more logos once the customization is done. so please let me know about it .looking forward to your response asap .
Trevor(Private) November 18, 2020 at 3:56 pm #266976If you edit the form, at the top are tabs. The third tab is ‘Posts’. This allows you to set a sort order, by one or two keys. Or do you need to make a more sophisticated sort, in which case you might need to sue this filter:
https://searchandfilter.com/documentation/action-filter-reference/#edit-query-arguments
If you use a plugin to drag and drop the order, this will likely conflict with our plugin.
Anonymous(Private) November 20, 2020 at 6:27 am #267216Hey Team,
Thanks for the response it was helpful and the problem is sorted now .
However i have one more issue to address . when i start using ajax to load my results. the jquery i add to my results to flip each element dont work. so i have analysed that whenever plugin’s ajax works, my jquery gets stopped. but that should be working fine actually because thats the requirement of my client. so can you help me sort that out. or send me a function which i can run like :
run my jquery code after that ajax call gets success or something like this ?
here is the results page : http://evc.thewebchef.co/investments/currently i have disabled ajax but i want to enable it . i might have shared login details of site with you but if not then please let me know if you need them because i really want it sorted .
looking forward to your response asap .
Trevor(Private) November 23, 2020 at 2:01 pm #267508Hi, you need to add a small snippet of JavaScript to reload that JavaScript, like this:
<script>(function ( $ ) {
“use strict”;
$(document).on(“sf:ajaxfinish”, “.searchandfilter”, function(){
// call your script or function here
});
}(jQuery));</script>Make sure you do NOT place that inside any code that runs on document load.
Anonymous(Private) November 24, 2020 at 4:38 pm #267657Hey Trevor,
I tried this script, but didnt work for me. can you check it whats wrong ?
(function ( $ ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ $('.f1_container').click(function() { $('.f1_container.active').not(this).removeClass('active'); $(this).toggleClass('active'); }); }); }(jQuery));
on this url, http://evc.thewebchef.co/investments/ .
Trevor(Private) November 25, 2020 at 9:31 am #267739I am sorry, your previous reply came in just before we closed for the day here in the UK, and we will be starting work in about half an hour. I am not an expert on JavaScript, so I am not the one to ask about your coding.
However, I checked the page you gave in that reply, and that code is not on that page, nor in any JavaScript files loaded by that page. That could be why it isn’t working.
Anonymous(Private) November 25, 2020 at 12:48 pm #267759That code is currently not in any files . because i added that , then removed because it was not working. and i shared link of the page and the full code with you so that you can try that code in console your side and see if there is any issue .
i have added my code in your script you sent. so can you debug that out ASAP please ?
-
AuthorPosts