Skip Navigation

[Geschlossen] Related Custom Post Taxonomies – Rewrite Slug

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created vor 11 Jahre, 2 Monate. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 3 Antworten, has 3 Stimmen.

Last updated by Caridad vor 11 Jahre, 2 Monate.

Assisted by: Caridad.

Author
Artikel
#47431
rewrite1.jpg

Hi, I have three different CPT, and in the URL of CPT 2 and 3, I would like to embed the "parent" slug of the CPT1.
So the permalink should look like this:

HOME / CPT1slug / CPT1content
HOME / CPT1slug / attractions / CPT2content
HOME / CPT1slug / districts / CPT3content

I was playing around with the "rewrite" function ("Rewrite permalinks with this format. False to prevent rewrite. Default: true and use post type as slug."). I can't get it to work however..
Is there a quick fix to this?

#47670

Bigul
Supporter

Hi Sanny,

I have tried the following and it is working. Please check and let me know your feedback.

1) Created Custom Post Type CPT1s,CPT2s and CPT3s. CPT1s is the parent.
2) Then given this value cpt1s/cpt2s to "Use a custom URL format" field of CPT2s
3) Then given this value cpt1s/cpt3s to "Use a custom URL format" field of CPT3s

---
With Regards

Bigul

#57398

Hi Bigul,

Thanks for your help. This is great, however I am not quite there yet. You can see for yourself at: hidden link

1.) it is now generating a 404 error if I try and open the link of the CPT2 and 3
2.) I would wnat to reference the parent post.

Let me make this a little clearer with my example below.

CPT1 = City Name
CPT2 = Attractions (linked to CPT1 as parent)
CPT3 = Districts in the city (linked to CPT1 as parent)

An example for the article on the city of Rome would be:
hidden link

Now, I would like to display the attractions in Rome like this:
hidden link

Is that possible? I'd even be willing to pay for getting this solved..
Thanks!

#58346

Dear Sanny,

I believe you will need to work with WordPress rewrite rules to do what you want:

http://codex.wordpress.org/Class_Reference/WP_Rewrite

The Types plugin is a user interface for WordPress Custom Post Types and we expose the features offered by WordPress in the plugin, but dont deal with rewrite rules in the plugin.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Regards,
Caridad

Das Thema „[Geschlossen] Related Custom Post Taxonomies – Rewrite Slug“ ist für neue Antworten geschlossen.