0

I've got a custom post type departments with a custom taxonomy department and am using Custom Post Type Permalinks plugin. In the CPT, I define the permalink like this:

'rewrite' => array(
  'slug' => 'departments',
  'with_front' => false
)

The permalink looks like /departments/article-name-here and the template I can use to modify it's look is here: single-departments.php. This works correctly.

But if I change my permalink for the CPT to use my custom taxonomy in the rewrite rule like this:

'rewrite' => array(
  'slug' => '%department%',
  'with_front' => false
)

The permalink now looks right: /department-name/article-name-here but single-departments.php doesn't work anymore. In fact, I can't setup a template naming structure that picks it up - I've tried all of them that I normally would use. I have flushed permalinks with each test via admin panel.

What am I missing here?

  • You normally can't define a slug like that, the format clashes with the built in page rewrite rules. – Milo Mar 16 '17 at 15:28
  • @milo - whats the right way to do this? – serraosays Mar 16 '17 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.