Skip Navigation

[Resolved] how to add subslug/subfolder on custom post type

This support ticket is created 7 years, 2 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 7 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#575537

Tell us what you are trying to do?

I have some PostType (City) with 2 child post types: HighSchool & Studienkolleg.
I want to make some page, where I could show just child posts, e.g.
I have studyinfocus.ru/city/cityname page for city,
but I want to show city highschools on studyinfocus.ru/city/cityname/highschool and studienkollegs on studyinfocus.ru/city/cityname/studienkolleg.

Is it possible to id like this and how could I make it?

#575557

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - there is no such native feature available using which you can rewrite the post type slug with its child post slugs.

Generally, you can alter the slug by using "Use a custom URL format" under "Rewrite" option, when editing your CPT (see the following screenshot). But here you want to have parent posttype post slug in child URL that is not naively supported.
=> hidden link

However, this can be done with some custom programming that may help you to build such permalinks. Please check following related ticket that may help you:
=> https://toolset.com/forums/topic/creating-url-from-parent-post-name-and-child-post-name/page/2/#post-353988

Here is Doc how you can use save_post action with Types - More info:
=> https://toolset.com/documentation/customizing-sites-using-php/updating-types-fields-using-php/

#575805

Thanks for some interesting suggestions. But this is a little bit different. In the post you mention they try to make some slugs like this:
hidden link)

I want to do something like this:

hidden link)

I don't want to show exact child in parent post page. But want to show different templates for one post type depend on URL and prefer to do it by a slug, not as a url parameter.

So, like

hidden link)
hidden link)

or
hidden link)
hidden link)

#575831

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - there is no such native feature available and it needs custom programming that is beyond the scope of our support policy.

However - I can tell you that content template stored with meta key name '_views_template' within postmeta table which stores content template ID. I hope this information may help you to assign the content templates created using Types.