Forums › Forums › Search & Filter Pro › Sort not working after first results
- This topic has 35 replies, 2 voices, and was last updated 8 years, 10 months ago by Ross.
-
Anonymous(Private) November 23, 2015 at 7:52 pm #30528
I am using this plugin for a custom post type that I built into the Avada theme. The template that I am using is based on the portfolio post type and uses a standard loop. I’ve read about the loop being a common cause of this issue with the Avada theme, but I’m not sure what else to do: http://befirst.wpengine.com/resources/
The first instance of the sort works, but then you cannot sort further. If you refresh the page, the page title changes to “Blog” (same sorted content) and then you can sort again, but only once. At this point, if you click the “Resources” page from the top menu, you will see all resources but the original sort selection is still showing as selected in the form and the URL shows a sort parameter (shouldn’t it do a hard refresh on the page?). This behavior only happens if you’ve refreshed the page. It seems like the first results page may not be loading correctly because I’ve had to use CSS to force the display of images (the fusion-image-wrapper loads with opacity:0). The images only show up if you reload the page, which loads with the exterior blog template shell with the resource results loop template (https://gist.github.com/smeyer/1645c5d2f694c06590dd). The image display issue is minor and addressed but is still a curiosity and may provide some insight into what’s happening.Could you help me to get this working correctly?
Thanks!
-Stephanie MeyerAnonymous(Private) November 23, 2015 at 10:57 pm #30543If I’ve refreshed the page, even if I’ve clicked on the resources page from the menu and cleared the parameters from the URL so that it appears to be showing “all”, if I select another parameter, it adds it to the previous inquiry (filtering for both). With this bug, it’s hard for the user to intuitively remove all of the filters.
Ross Moderator(Private) November 23, 2015 at 11:48 pm #30544Hey Stephanie
I think I might know what this is. What happens if you disable Ajax? (I’m guessing it will pretty much work correctly).
Do you have a link I could look at?
Thanks
Anonymous(Private) November 24, 2015 at 5:45 pm #30638If I disable AJAX, I get the results as described above when refreshing the page. I can continue to sort, but it uses the blog template and is not intuitive to clear the filters. I can force it to use is_search and it will then say “Search for:” instead of “Blog” in the title bar. It doesn’t include the terms in the title though, which would be helpful in the user experience.
AJAX is the desired functionality. It’s bad enough that I am not duplicating the nice slide sort feature from Avada. Is there a work around?
Any idea how to improve the title bar?
http://befirst.wpengine.com/resources/
Thanks!Ross Moderator(Private) November 25, 2015 at 4:03 pm #30751Hey Stephanie
That URL is password protected.
Thanks
Ross Moderator(Private) December 2, 2015 at 11:53 pm #31293Hi Stephanie
Ok I see what is going on.
When you load the page, Avada runs some JS, that basically lays out the page in this Masonry style.
So, when you don’t have Ajax, a page loads, runs Avada layout JS – however, with ajax, Avada JS is not run every time – because you are not reloading the page.
Please see the first question in the FAQs – http://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/ – there are events to use which tell you when S&F has loaded the results via JS, and it is here you would add the Avada layout code.
If you want to modify the page title, it is possible but not a feature of S&F directly just yet.
Please see this post with some more information: https://support.searchandfilter.com/forums/topic/custom-page-titles-meta-descriptions/
What you want to do is use the WP filter for page titles, and modify it using the the Active Query class found here: http://www.designsandcode.com/documentation/search-filter-pro/accessing-search-data/
Thanks
Anonymous(Private) December 9, 2015 at 12:32 am #31787http://befirst.wpengine.com/resources/
I added the Ajax functionality back to the Search Form.
I added the following to above the footer on the template the displays the resource page:
<script>
jQuery(function ($) {
console.log(“ajax test”);
$(document).on(“sf:ajaxfinish”, “.searchandfilter”, function(){
console.log(“ajax complete”);
});
});
</script>and only “ajax test” appears in the console.
Since the sample code doesn’t write to the console as provided, I’m not sure what to do from here.
Can you please advise?
Thanks. -
AuthorPosts