url rewriting - Custom post type archive with page as parent url

I have a custom post type called articoli-redazione. I would like to make archive url of this kind of post type to have

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 badges
Add a comment  | 

1 Answer 1

Reset to default 3

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/'.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745312594a4622069.html

相关推荐

  • url rewriting - Custom post type archive with page as parent url

    I have a custom post type called articoli-redazione. I would like to make archive url of this kind of post type to have

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信