1

I've got a custom taxonomy that is set to Hierarchical = true. However, when I try to access them hierarchically in the URL, it doesn't work.

i.e.

| Training (Taxonomy Name)
| - test-taxonomy
| - - another-test-taxonomy

My expected URL would be mysite.com/training/test-taxonomy/another-test-taxonomy/. That gives a Page Not Found error though.

I can access both test-taxonomy and another-test-taxonomy like so: mysite.com/training/<slug>, but it doesn't seem to work hierarchically.

2 Answers 2

2

11 years late, but I just found the solution to this problem in Gavin's link: https://wordpress.org/support/topic/hierarchical-custom-taxonomy-permalinks/#post-1520946

To implement the solution, in my call to register_taxonomy, I changed the

'rewrite' => array(
    'slug' => 'training'
)

part to

'rewrite' => array(
    'slug' => 'training',
    'hierarchical' => true
)

I then went into my Permalink Settings page ( https://example.org/wp-admin/options-permalink.php ) and just clicked the Saved Changes button and, having it large, the URLs of my hierarchical custom taxonomy are now also hierarchical - and they work on every level!! Sorted.

Sign up to request clarification or add additional context in comments.

Comments

1

Check this: http://wordpress.org/support/topic/hierarchical-custom-taxonomy-permalinks

Here's the trac ticket: http://core.trac.wordpress.org/ticket/12659

Unfortunately, the bottom line is it can't be done without some serious hacking right now - ran into the same problem a few weeks ago. Likely in near future releases, I would think.

1 Comment

That's what I was afraid of. Thanks for the info, Gavin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.