> For the complete documentation index, see [llms.txt](https://wplake.gitbook.io/advanced-views/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wplake.gitbook.io/advanced-views/query-content/taxonomy-filters.md).

# Taxonomy Filters

## How to use it

Create a *Post Selection* and assign a *Layout* as usual. (See [Creating Your First Post Selection](/advanced-views/getting-started/introduction/creating-your-first-post-selection.md)).

**Switch** to the *Taxonomy Filters* tab.

**Click** on the **Add Rule** button.

**Click** on the **Add Taxonomy** button.

In the **Taxonomy** dropdown, select which taxonomy you want to use.

For the *Comparison* field, select how you would like to compare the taxonomy.

Then **select** Term from the dropdown that will be used for comparison.

Click **Update** to save your *Post Selection.*

{% hint style="info" %}
Note: adding another Rule will create a relation to control how taxonomy rules will be joined within the taxonomy query using AND or OR.
{% endhint %}

## Dynamic Injection

By default, the Taxonomy filter expects a statically defined term, such as creating a *Post Selection* to query by the 'books' term. However, sometimes you need to define this argument dynamically. For this purpose, there is a 'Dynamic Term' field.

{% hint style="info" %}
&#x20;The 'Dynamic Term' field becomes visible only when the 'Static Term' field has no selection, and visa versa.
{% endhint %}

The 'Dynamic Term' field supports the following values:

### **$current$**

&#x20;For archive and category pages.

### **$meta$**

For specific meta fields. For example, if you have a page with a Taxonomy meta field and need to query all posts with the term selected on the current page, you can use `$meta$.field-name`.

### **$custom-arguments$**

Allows defining the argument dynamically from [custom shortcode arguments](/advanced-views/shortcode-attributes/common-arguments.md), e.g., `[avf-post-selection custom-arguments="genre=my-genre-slug"]`.

**Note:** This method is useful for manually defined cases. If you need to get the value from the current page meta, using the `$meta$` mentioned above.&#x20;

## Others

{% hint style="warning" %}
Note: Do you want to customize a query (WP\_Query) that is used to get posts for a *Post Selection*, but the option is missing in the UI? You can do this using our filters. [Read more here](/advanced-views/customization/filters-and-hooks/post-selection.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://wplake.gitbook.io/advanced-views/query-content/taxonomy-filters.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
