1

I want the url for my custom post type to be like :
"example.com/parent-custom-post/child-custom-post/grandchild-custom-post/"
without setting the hierarchical(for custom post type) to true. I heard that i should use a non-hierarchical custom post type, a hierarchical custom taxonomy, and rewrite rules. But i dont understand, if i have a non-hierarchical post type, the posts will not have relationship with each other, so how should i make the slug for different unrelated posts to be in the same url? And how should i tell wordpress, which unrelated post is the parent and which is the child?

  • Is there a specific reason not to use non-hierarchical post type ? – Sladix Dec 10 '15 at 13:36
  • @Antoine Guillien coz i saw this in the wordpress codex, hierarchical part says: "Note: this parameter was planned for Pages. Be careful, when choosing it for your custom post type - if you are planning to have many entries (say - over 100), you will run into memory issue. With this parameter set to true WordPress will fetch all entries of that particular post type, together with all meta data, on each administration page load for your post type." Do u know how can i achieve this without hierarchical post type? – vid Proli Dec 10 '15 at 13:48

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.