FacetWP template provide query results in multiple sections (or by facet)

1.7k Views Asked by At

I have FacetWP setup to provide results of a query based on 4 facets (one Search box, one Categories drop-down, and two custom taxonomy drop-downs).

What I'd like is to list the results in two sections:

  • tribe_events results
  • posts with events filtered out

I tried to display the results using two Templates as follows:

return [
  "post_type" => [
    "tribe_events"
  ], ...

and

return [
  "post_type" => [
    "post"
  ], ...

This causes the unfiltered page, which should show all posts, to show only event posts -- the same list of posts for both Templates.

I suspect this is because within the loop, the filter conditions must be combining, but I don't understand how these can be displayed separately. Any similar code you can show me, or experience with doing this in FacetWP?

1

There are 1 best solutions below

0
Rickmakeitquick On

My hunch was correct, it has to do with the loop. Apologies for the trite/incomplete answer; this is beyond what I can handle right now but I'd like to provide this very helpful trail for anyone who might need it.

This Gist posted by a FacetWP member provides the logic needed to divide the search results by facet based on one's own needs.