Skip to main content

Conditional filters

PRO Only

What conditional filters do​

Conditional filters show or hide individual Filter Posts Item blocks depending on what the visitor selected elsewhere—similar to conditional logic in forms.

Examples:

  • Show Subcategory only after a Parent category is selected
  • Show Size only when Category: Clothing is active
  • Hide Map radius until Region is chosen

Enable conditional logic​

  1. Select a Filter Posts Item in the block editor.
  2. Open Conditional logic settings (Pro).
  3. Enable Conditional logic.
  4. Add rules:
    • When [filter item / field] [is / is not] [value]
  5. Choose Match all (AND) or Match any (OR) for multiple rules.
  6. Save and test on the front end.

Hidden filters receive the conditional_hide class and are excluded from active filtering until rules pass.

Subcategory patterns​

A common pattern for hierarchical taxonomies:

  1. Filter item A: Parent category (Select)
  2. Filter item B: Child category (Select), conditional on A matching parent term

When the parent changes, child options refresh via AJAX. Test that clearing the parent hides or resets the child.

Conditional categories (dynamic options)​

Pro supports conditional category filters where child term lists depend on the parent selection. Configure parent and child items with matching conditional rules and taxonomy hierarchy settings.

Developer note​

Conditional visibility re-evaluates after filter updates. Custom scripts can hook handle_conditional_fields or listen for divi_filter_completed to sync third-party UI.

PHP filter: daf_filter_posts_item_render_conditional_logic — see PHP hooks.

Troubleshooting​

IssueCheck
Filter never appearsRules too strict; test with OR instead of AND
Filter flashes hiddenInitial load vs AJAX—verify first-load conditional AJAX setting
Wrong resultsHidden filter may still hold old values—use Reset

See Stale or wrong results.

What's next​