Skip Navigation

[Resolved] Add relationship 1 to the url before related title

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 6 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#914400

Hello 🙂

I just got into the relationship part, and it seams promising.

Type: One to Many
Parent CPT (one): Layouts - slug: layout
Child CPT (many): Layout Templates: slug: layout-template

An example will be:
Layout name: Life Style
Layout Templates: Home - Services - Contact

The URL goes like this.
domain.com/layouts (seeing all my layouts)
domain.com/layout/life-style (showing this layout overview)
domain.com/layout-template/home (showing the home page in the above layout)

What I want is this URL:
domain.com/layout/life-style/home
I can't figure out to get this URL. I've played around in the dashboard for my post types with no luck.

Basically, I want to add the parent relationship URL and then the child

-------------------
Hope you can help me 🙂

Keviin

#914541

Dear Keviin,

There isn't such kind of feature within two different post types, it'd require elaborated Custom Code.

I suggest you try to merge post type "Layouts" and "Layout Templates" into one hierarchical post type, just like the wordpress built-in post type "Page", for example, edit post type "Layouts", in the section "Options", enable option "hierarchical".

More help:
https://developer.wordpress.org/reference/functions/register_post_type/#parameters
'hierarchical'
(bool) Whether the post type is hierarchical (e.g. page). Default false.