Posts 2 Posts
Permalink structure for nested posts (3 posts)

  1. tetele
    Posted 4 years ago #


    Suppose I have a website where I use 2 custom post types, towns and zones. Zones are related to towns (meaning a zone belongs to a town) and the connection is made using the plugin like so.

    p2p_register_connection_type( 'zone', 'town', false ) );

    Obviously, there will be situations where 2 distinct zones have the same name, although they are in separate towns. E.g. chicago/downtown and philadelphia/downtown.

    Is there a way I can use the plugin or define the custom post types in order to use the same slug for the zones or at least have a nested permalink structure containing more than 1 custom post type?

    Or am I getting a wrong idea about this whole connection concept?

    Thanks in advance!

  2. scribu
    Plugin Author

    Posted 4 years ago #

    Are you sure you can't make 'zone' into a custom taxonomy for the town post type?

  3. tetele
    Posted 4 years ago #

    Actually, the scenario goes even futher, having events (another custom post type) linked to zones (one to one relationship).

    So, the full hierarchy of taxonomies (not necessarily in the WordPress sense) is something like town->zone->event[->something else, optionally]. I thought I could model this using the plugin. In fact, I *can* do that, but the permalink structure is giving me a very hard time.

    Still, your idea of using custom taxonomies is excellent! Both towns and zones could just be taxonomies for the event custom post type, which just leaves the permalink structure to deal with. I found some useful hints here and I'd be very thankful if you could point out any others.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts 2 Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic