---
title: "Custom taxonomy for filter"
date: 2018-09-09
author: "nK"
---

# Custom taxonomy for filter

The Filter element lists the Portfolio categories and tags. To let it list a custom taxonomy as well, use one of the two methods below.

## A. Method with PHP code

The `vpf_allow_taxonomy_for_filter` filter decides whether a taxonomy may be used in the Filter. Return true for the one you want:

```
<?php

add_filter( 'vpf_allow_taxonomy_for_filter', 'my_filter_vpf_allow_taxonomy_for_filter', 10, 2 );

function my_filter_vpf_allow_taxonomy_for_filter( $allow, $taxonomy ) {
    if ( 'my_custom_taxonomy' === $taxonomy ) {
        $allow = true;
    }
    return $allow;
}
```

## B. Method with settings

You can also add the custom taxonomy slug in the plugin settings, without writing any code:

![](https://staging.visualportfolio.com/wp-content/uploads/2024/07/Shot-2024-07-15-at-20.19.27-1024x600.png)![](https://staging.visualportfolio.com/wp-content/uploads/2024/07/Shot-2024-07-15-at-20.19.27-1024x600.png)