# Ajax Filter Facet

**The main filtering element that lets users filter by taxonomy, custom fields, or product attributes.**

**Content > Query Settings**

| Setting                 | Description                                                                |
| ----------------------- | -------------------------------------------------------------------------- |
| **Query Name**          | Must match your Main Query's query name                                    |
| **Meta Type**           | What to filter by: Taxonomy, Custom Field, WP Post Meta, Product Attribute |
| **Select Taxonomy**     | Choose taxonomy (category, tag, custom taxonomy)                           |
| **Select Attribute**    | For WooCommerce product attributes                                         |
| **Meta Key**            | For custom field filtering                                                 |
| **Show Top-level Only** | Only show parent terms, not children                                       |
| **Use Query Parameter** | Add filter values to URL for shareable links                               |
| **Order By Options**    | Sort options by: Name, ID, Count                                           |
| **Terms Exclude**       | Exclude specific terms from appearing                                      |

**Content > General Settings**

| Setting               | Description                                                                                                        |
| --------------------- | ------------------------------------------------------------------------------------------------------------------ |
| **Layout Type**       | Dropdown, Checkbox, Radio, or Button                                                                               |
| **Logic**             | AND (must match all) or OR (match any) - for checkbox/multiselect                                                  |
| **Multiselect**       | Allow multiple button selections                                                                                   |
| **Placeholder**       | Dropdown placeholder text                                                                                          |
| **Hide Count**        | Hide the post count next to each option                                                                            |
| **Hide Empty Option** | Hide options with no matching posts                                                                                |
| **Hide 'All' Option** | Remove the "All" option (radio/button)                                                                             |
| **Label: All**        | Customize "All" option text                                                                                        |
| **Legend Label**      | Accessibility label for checkbox/radio groups                                                                      |
| **Apply On**          | Input (immediate) or Submit (wait for button)                                                                      |
| **Child of**          | Only show terms that are children of a specific parent term. Enter the parent term ID to scope the facet.          |
| **Max depth**         | Limit how many levels deep the facet tree goes. Set to `1` for top-level only, `2` for one level of children, etc. |

**Layout Types Explained**

**Dropdown**

* Clean, space-saving
* Best for: Long lists, mobile-friendly designs
* Single selection only

**Checkbox**

* Multiple selections with AND/OR logic
* Best for: Allowing multiple filter combinations
* Shows all options at once

**Radio**

* Single selection
* Best for: Mutually exclusive options
* Includes "All" option by default

**Button**

* Visual, clickable buttons
* Can be single or multiselect
* Best for: Featured filters, visual designs

**Usage Example**

```
Filter by Category (Checkbox):
1. Add Ajax Filter Facet
2. Query Name: "blog-posts"
3. Meta Type: Taxonomy
4. Select Taxonomy: "category"
5. Layout Type: Checkbox
6. Logic: OR
7. Apply On: Input
```

#### Range slider

{% embed url="<https://drive.google.com/file/d/10PfRXxbgcLrPlTs-A5QYP0eWuA8rirX7/view?usp=sharing>" %}

#### Image and color swatches

{% embed url="<https://drive.google.com/file/d/1l4GnstUII7veo5RjVU_BCH0ibAAS39VW/view?usp=sharing>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.woohoo.dance/ajax-filters/elements/ajax-filter-facet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
