Skip Navigation

[Resolved] Add parent to a Custom Post Type’s URL

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to use a hierarchical directory structure in my custom post type permalinks.

Solution: Custom code or a 3rd-party plugin is required to show a hierarchical directory structure like this.

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Laura Savard 6 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#742867
Screen Shot 2018-04-26 at 9.18.34 AM.png
Screen Shot 2018-04-26 at 9.18.44 AM.png
Screen Shot 2018-04-26 at 9.18.54 AM.png
Screen Shot 2018-04-26 at 9.27.09 AM.png

Hi Christian, Hope you're well.

I have a section set up on our site called "Brand Related". Within that section, I have several subsections using Custom Post Types. For example, I have Brand Terms, Brand Quotes, Brand Facts… all living within Brand Related.

The issue I'm seeing is that, when I look at the breadcrumbs and/or URLs, they're not reflective of the hierarchical parent/child structure. (see attached screen shots). Everything seems to work, until the point where you actually go to one of the individual brand term pages.

Main landing page for Brand Terms
Correct: …/brand-related/brand-terms/

All Terms starting with the letter A (set up with Toolset Views)
Correct: …/brand-related/brand-terms/a/

Individual Brand Term Page
Incorrect: …/brand_terms/accelerator-principle/
Ideally, this should be: …/brand-related/brand-terms/a/accelerator-principle/

Secondly, when I try to change the custom post type slug to "brand-terms" instead of "brand_terms" I get an error message (see attached screen shot). Not sure if or how this is fixable.

Thanks in advance for your help.

Cheers,
Laura

#744463

Hi, that's correct, the URL structures generated by Toolset conform to WordPress standards for custom post types - /cpt-slug/post-slug. To show a hierarchy using directories, it would require custom code or a 3rd party plugin that handles custom permalinks. Unfortunately that falls outside the scope of support we provide here in the forums.

#745420

Christian,

I believe I saw another post that mentioned a plugin that did this. I'll see if I can locate that and give it a shot.

Thanks for the response!
Laura