I’m setting up advanced search for a site I’m building that is built off Sage. Everything has gone along well, except for setting up this advanced search section where I have been unable to get the FacetWP working, despite it working with other non-Sage/Roots site I have built.
I have noticed that a few people on these forums have used/suggested FacetWP with Roots sites, but I would like to know whether anyone has got it successfully working and what they have had to do?
By following the recommended set up by FacetWP I have had no success, but as soon as I switch back to a default WP theme, it works fine.
Anyone have any experience here?
I don’t think you actually explained what’s not working.
Essentially I am trying to integrate the plugin as per this page: https://facetwp.com/documentation/template-configuration/. What should happen is that is that the custom search parameters I have set up, will appear in the sidebar widget. But whenever I try this with my Sage theme, you can see it starts to work as it outputs a custom div, but it never includes any of the ajax items.
I have tested that on a default WP theme on the same site and it works, the same approach with my custom Sage theme, does not work.
As per the documentation I have a div surrounding my search loop which includes <div class"facetwp-template">, then in my base (that has my sidebar), I include a widget which is supposed to output the faceted search interface.
I suspect that the way Sage theme has a heavily customised functions.php file is interfering with things, as the functions file set it is a major difference between my custom Sage theme and a default WP theme.
I was hoping someone in the community might have had experience with using Sage/Roots and FacetWP before…
I’ve already used Facet WP with Sage, can you post more infos about your code (loop file + facet sidebar )?
We can have a look together.
That’s great to hear and thanks for helping out.
I set up this gist previously: https://gist.github.com/Ashkas/77708db11d6f5fc2e3ab
The first two code snippets are the original set up I tried. The second two snippets (functions and search variation), were a different approach by simply trying to link it in with a custom query.
Matt from FacetWP is a great guy and provides great support. You should email him and he will get you sorted out. I have implemented FacetWP on a few sites with Sage with no issues whatsoever.
Thanks @ashkas for the Gist,
I had a look at the code and tried to replicate it in a local enviroment and yes, I had the same problem with search template, it works fine with post / post type archives.
It’s strange because according to FacetWP documentation search template should be autodetect:
Anyone has an idea?
I finally tracked down the issue after some feedback form matt at FacetWP. The set up was all correct, there was a JS clash that was preventing the ajax script from loading. Fixed the clash now working like a charm!
thank you for updating us about this topic. Was the JS clash related to Sage?