Dynamic Filter with L&L

I created a product gallery using ACF and tangible template, my question is how can I filter the results dynamically, with a category select?

There are two main approaches I’ve seen people use.

The first is to use a plugin like FacetWP if you want JS-based faceted loop filtering. There are a few threads on the forum that should help get you started.

Alternatively, if you want to go L&L-only, you could create buttons that add parameters to the current URL (essentially a link to the current page) like href="mysite.com/current-page/?category=my-category-name" and then use the Url tag’s query attribute to modify your L&L template based on the value of the parameter in the URL. Something like:

<Loop type=post category="{Url query=category}">
  <Field title />
</Loop>

I recently went the FacetWP route and it was pretty painless and feels slick. Hopefully, that helps guide you in the right direction!

Perfect. Thank you so much

1 Like