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:
The custom post type needs to be hierarchical.
Is that possible? Is there a way to have a custom rewrite?
Thank you!
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!
Share Improve this question asked Jul 18, 2019 at 12:35 StefanoStefano 1391 gold badge3 silver badges13 bronze badges1 Answer
Reset to default 3Yes. 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/'.