I've been around this problem for 2 days, googling and experimenting with no avail.

I have this Custom Post Type name "programas", and a page with the same name.

The page "Programas" lists all the CPT "programas", and the permalink of a "programas" is /programas/name-of-cpt-post/, so far so good.

Now, each "programas" will have a detail, and the permalink should be /programas/name-of-cpt-post/detail-of-programa/. This detail is also a CPT, with the alias "detalhe-programas".

In this CPT, I choose what "programas" is the parent, so far so good.

My problem is this:

Without any change, new "detalhe-programa" permalink will be /detalhe_programas/name-of-cpt-programa-parent/detalhe-programa-post/ but I need for SEO sakes, that the structure of the link stays /programas/name-of-cpt-programa-parent/detalhe-programa-post/ (/list/parent/child)

So, on the "detalhe-programa" I've set this: 'rewrite' => array('slug' => 'programas'), but with this, every page related with "programas" (list, parent, child) is 404.

Can anybody help me? I'm completly lost!


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.