最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

permalinks - How to add rewrite rule to custom post type with parent in url with cpt ui?

matteradmin10PV0评论

I'm trying to create custom post types but i need the posts of custom post type to have the url along with parent category. Example for now i have custom post types science, tech, business. The url of each post is mysite/science/postname. what i need is mysite/articles/science/post name. I tried giving articles/science in rewrite rule of cpt ui but it gives 404 error. Can you guys point me to right direction? Thank you

I'm trying to create custom post types but i need the posts of custom post type to have the url along with parent category. Example for now i have custom post types science, tech, business. The url of each post is mysite/science/postname. what i need is mysite/articles/science/post name. I tried giving articles/science in rewrite rule of cpt ui but it gives 404 error. Can you guys point me to right direction? Thank you

Share Improve this question edited Oct 17, 2018 at 18:15 MJN asked Oct 17, 2018 at 18:02 MJNMJN 1132 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

hierarchical must be set to true and make sure you have the Article post type set as the parent of the science post type

....and be sure to flush the permalinks after making changes

Post a comment

comment list (0)

  1. No comments so far