Roots Discourse

Controller (soberwp) with FacetWP

I’m currently building a site for a customer with ACF content modules (flexible layout). Some of these modules consist of a listing & filters for which I use FacetWP.

I build everything with the controller, here is a snippet of the loop over the layouts and loading a specific template for it: https://gist.github.com/vdrnn/1f98f7d78542eab5ad35442e4dd6d7d9

The data gets filled likes this where I create a loop and fill the results into the array: https://gist.github.com/vdrnn/efd6507b080e7540c6fef07d8a423c37

However, this solution doesn’t work with the way FacetWP works. Basically right now multiple loops gets executed and the filtering doesn’t work.

My question, does anyone here tried to solve this in combination with the controller?
My goal would be to not create the custom loop in the template itself but in the controller.

Any hints appreciated :wave:

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.