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?
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
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!
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