L&L + FacetWP Integration?

Is there any way to use FacetWP with L&L? When I place the facet on the page, it doesn’t seem to register that there is a post query on the page that it can filter.

Current workaround is using a L&L shortcode inside of a Beaver Builder post module

Hi Zack,

FacetWP relies on the default query to work, so it’s a little tricky.
Here’s an article that explains it in more detail:

1 Like

Thanks Gabriel! Quick side question. After reading the doc you linked, what does this part mean?

Expert Level: Add taxonomy headings to a FacetWP-compatible loop

Is it like this? Where each section of the grid will display a taxonomy heading?

Pretty much like that! I came up with this approach in the context of a team member listing grouped by a custom “role” taxonomy :slight_smile:

Yeah, I’ve ran across this before (in the screenshot I posted, and well as in a scenario like you mentioned) and had never been able to come up with a way to do it…

I have a project that uses FWP and wanted that layout. Seemed impossible at the time :rofl:

For another project that doesn’t use FWP, what extra pieces can be removed if you’re not doing it with FWP? Obviously stuff like class=“facetwp-template”
Anything in the “Step 2: Modifying the query” that is FWP specific? Doesn’t really look like it…

1 Like

Modifying default queries using pre_get_posts isn’t specific to using FacetWP, but is only really necessary for this posts by taxonomy structure if you are using it.

From FacetWP’s documentation:

When the Re-index button is clicked, FacetWP first retrieves all post IDs that should be indexed. It uses WP_Query, and the query arguments are customizable.

FacetWP then loops through the array of post IDs. For each, it loops through all available facets and saves applicable values.

From How FacetWP works

FacetWP looks at the query and indexes all of the information it needs to sort your posts ahead of time, so you need to make sure that the query it’s using is accurate and matches perfectly with what you’re outputting in L&L. When you’re not using FacetWP you can just create a nested loop with L&L if you’d prefer:

<Loop type=taxonomy_term taxonomy=my_custom_tax>
  <h2><Field title /></h2>
  <Loop type=my_custom_post taxonomy=my_custom_tax terms="{Field id}">
  ... post item content ...

Ah, ok. Thank you. Brand new to L&L so trying to absorb as fast as possible. I use BB & Themer + ACF extensively, but sometimes, in cases like this, it’s not possible to get what you want - in comes L&L!