Support » Plugin: Custom Post Type UI » What Does the Hierarchical Setting Actually Do

  • Resolved willowen100

    (@willowen100)


    Hi

    I’m trying to get my head around how custom post types work and all of the setting combinations. What is the physcial difference between enabling true or false for the ‘Hierarchical’ option under the settings? Does it affect the URL?

    I have read that it’s something to do with a parent-child relationship. Does this mean if I create a CPT and set it as the parent does a second CPT become the child or are the taxonomies the children here? If the parent-child relationships is for CPT’s excluding the custom taxonomies where do I set one CPT to be a parent and another to be a child?

    N.B After playing around with the custom taxonomies how do I get the URL to display https://domain.com/custom_post_type/custom_taxonomy? Basically I can’t find out how to display the taxonomy after the CPT.

    Many thanks

    Will

    • This topic was modified 3 years, 8 months ago by willowen100.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    What is the physcial difference between enabling true or false for the ‘Hierarchical’ option under the settings? Does it affect the URL?

    It can, depending on what you do with your posts. Hierarchical basically makes the post type behave more like pages, where you can have that parent/child page relationship that you mention. If I had a post type named “food” and a parent page of “sandwich”, and a child page of “turkey”, when I viewed that turkey post, the url would be something like mysite.com/food/sandwich/turkey/

    This only affects posts within the post type, not multiple post types being “related” to each other. A post type of “food” would not be a child of a post type of “drink”. They don’t mix that way.

    Getting post type slugs and taxonomy slugs in the same url and viewing content is not something our plugin covers at all, though it’s often a question. That delves into the areas of permalink customization and rewrite api. That said, it’s definitely possible from everything I’ve seen and experienced in my time with WordPress, but it’s more involved at the code level.

    Thread Starter willowen100

    (@willowen100)

    Is it okay If you check out my friends post regarding our website please? We really need to get a structure sorted out for our website but we have no idea which way we should go with it. There is currently onlt the two of us, wtuh myself knowing slightly more about WordPress. It’ll be nice to know if your plugin will be of any help and obvisouly because the custom URL strucute is going to require some custom coding where can we seek advice on this? I have tried the Stack Exchange forums but I only got one reply.

    https://wordpress.org/support/topic/required-help-for-website-structure/

    Many thanks for your help so far

    Kind regards

    Will

    Thread Starter willowen100

    (@willowen100)

    In regards to your exmaple, I created a CPT called ‘food’ and then created a taxonomy called ‘ sandwich’. I then headed over to the new ‘food’ menu and added a sandwich (category) called ‘ham’. Finally I clicked ‘add new food’ and named the title ‘tasty’ and the URL automatically defaulted to http://test-site.com/food/tasty/. However, I was expecting http://test-site.com/food/sandwich/ham/tasty.

    Is there something I’ve I missed? P.S I have the ‘Rewrite’ and ‘Hierachal’ settings set to true in the CPT and taxonomy.

    Will

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    I sadly don’t have any readymade answer for this type of customization and extension, as it always ends up me doing trial/error for it. The permalinks you’re seeing are what I am familiar with seeing for structure, out of the box with WordPress.

    As an alternative, I believe I’ve recommended https://wordpress.org/plugins/permalinks-customizer/ in the past, but don’t really have any hands on experience with it.

    Worth a shot.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘What Does the Hierarchical Setting Actually Do’ is closed to new replies.