I'm having trouble getting my url structure the way I want.

I have a page with two sections:

  • private

  • company

Let's take private as an example. In this area, I wan't to have a url structure like this:


Where private is the front page, /customerservice a sub-page of that, and /faq is a subpage of /customerservice. I want a my custom post type posts called FAQ to end up at private/customerservice/faq/%postname%.

Can this be done? And if not what are my options to get something similar?

In my CPT code right now I have:

$rewrite = array(
    'slug'                => 'private/customerservice/faq',
    'with_front'          => true,
    'pages'               => true,
    'feeds'               => true,

This will render my CPT post at the desired location, but private/customerservice/faq returns 404. privat/customerservice/ returns 404 aswell, or as expected the archive if I have set has_archive to true.

Any ideas about what I can do?

  • it should be possible. is your post type non-hierarchical? I'm also fairly certain you don't want with_front to be true, though in this case it probably wouldn't make a difference. – Milo May 11 '15 at 19:31
  • No it's hierachical. Should it not be? Even if it's hierarchical, I can't set a page to be my CPT parent or can I? – Johan Dahl May 11 '15 at 20:38
  • Surely this problem must be something other people have come across? – Johan Dahl May 13 '15 at 12:33

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.