> 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/post-selections/filters/taxonomy-filters.md).

# How to filter posts by Taxonomy

Categories, tags, product categories, and formats are some of the more commonly known taxonomies. Use this feature to show a set of posts for a specific taxonomy.

## 1. How to filter posts by Taxonomy

1. Create a [*Post Selection*](/advanced-views/getting-started/first-post-selection.md) and assign a *Layout* as usual.
2. **Switch** to the *Taxonomy Filters* tab.
3. **Click** on the **Add Rule** button.
4. **Click** on the **Add Taxonomy** button.
5. In the **Taxonomy** dropdown, select which taxonomy you want to use.
6. For the *Comparison* field, select how you would like to compare the taxonomy.
7. Then **select** Term from the dropdown that will be used for comparison.
8. 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 %}

## 2. Dynamic Injection feature

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:

### **2.1) $current$**

&#x20;For archive and category pages.

### **2.2) $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`.

### **2.3) $custom-arguments$**

Allows defining the argument dynamically from [custom shortcode arguments](broken://pages/Q9E45EWEn44hlMSIRrK9), 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;

## 3. 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](broken://pages/izA2sJjzkuE0qLwqBWbA)
{% endhint %}
