0

I have a custom post type called articoli-redazione. I would like to make archive url of this kind of post type to have a PAGE as parent as in this example:

https://mywebsite.it/page-name/custom-post-type-archive

The custom post type needs to be hierarchical.

Is that possible? Is there a way to have a custom rewrite?

Thank you!

1

Yes. First, unregister the post type. (None of the actual data will be deleted if you already have posts.) Then, re-register it with

'rewrite' => array('slug' => 'page-name/custom-post-type-archive')

This will set your archive at the URL you're looking for, and all the individual CPT posts will be "under" that - i.e. '/page-name/custom-post-type-archive/single-title/'.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.