# Controller for custom taxonomy not working

**URL:** https://discourse.roots.io/t/controller-for-custom-taxonomy-not-working/20890
**Category:** sage
**Tags:** sage9
**Created:** 2021-06-04T15:16:02Z
**Posts:** 2

## Post 1 by @MikeFishtank — 2021-06-04T15:16:02Z

Hi

So I have a custom taxonomy: **maintenance\_package**

I am using the following blade template which is working fine…

**taxonomy-maintenance\_package.blade.php**

For bug fixing this issue, it just has this code in it…

```
@extends('layouts.app')

@section('content')
    {{ $testing_controller }}
@endsection
```

What I cant seem to do is get a controller working with the template.

My assumption was that it would be named this…

**TaxonomyMaintenancePackage.php**

And its contents would be this…

```
<?php

namespace App\Controllers;

use Sober\Controller\Controller;

class TaxonomyMaintenancePackage extends Controller
{
    public function TestingController()
    {
        return 'Hello World';
    }
}
```

\*\* _I have also tried it as a static function which also doesn’t work_

The error I am getting is…

```
Notice: Undefined variable: testing_controller in /Path/To/My/Cache...
```

I have tried these class/controller file naming structures with no joy…

- Taxonomy\_Maintenance\_Package
- TaxonomyMaintenance\_Package
- MaintenancePackage

**Additional info…**

Im using Sage v9.0.9

The taxonomy is created using the plugin below and uses underscores between its naming of the slug which I thought might be an issue maybe? possibly?

> **[Custom Post Type UI](https://wordpress.org/plugins/custom-post-type-ui/)**
>
> Admin UI for creating custom post types and custom taxonomies for WordPress

Any help would be gratefully received… :slight_smile:

---

## Post 2 by @strarsis — 2021-06-06T14:34:30Z

You can use a debug plugin like Query Monitor or Debug Bar to show a list of all attempted template paths for a taxonomy:

> **[Query Monitor](https://wordpress.org/plugins/query-monitor/)**
>
> Query Monitor is the developer tools panel for WordPress.

[https://wordpress.org/plugins/debug-bar/](https://wordpress.org/plugins/debug-bar/)

Related issue:  
[https://discourse.roots.io/t/sage-9-taxonomy-template/18620/4](https://discourse.roots.io/t/sage-9-taxonomy-template/18620/4)

---

## Post 3 by @system — 2021-07-16T15:16:03Z

This topic was automatically closed after 42 days. New replies are no longer allowed.
