Hide a Div if Post Taxonomy is not Selected

I am trying to set a condition on a nested accordion div to show only if the filter used for taxonomy colors is not empty. Hide if empty.

But it does not seem to work, what am I doing wrong?

1 Like

Hi waqar,
did you find a solution meanwhile?
I want to hide an Accordion-Item when facets are empty or if another facet has or has not a specific value.
Rebecca

@waqar Did you manage to make it work?

You could add the following custom CSS to the accordion item.

%root%:not(:has(li)) {
  display: none;
}

This way whole item block will be hidden if no <li> elements are inside.

It works as it looks like Bricks don’t render <li> elements if there are no filter checkboxes for the page you are on.

However, it doesn’t seem to me as a solution, only a “hack” / temporary workaround.

@itchycode - would you know how to do it?

Thanks!

Kindly try Filter: Empty interactions.

1 Like

Brilliant! That was the solution! Thank you @itchycode :green_heart: