Support » Plugin: Posts 2 Posts » How To/Should I – do a nested query to display multiple Custom Post Types

  • Resolved Preston

    (@pkdsleeper)


    I have 3 Custom Post Types

    1. Attorneys
    2. Practice Areas
    3. Practice Groups

    Attorneys CPT

    I have registered a connection to the Practice Areas CPT such that an Attorney can select one or many Practice Areas (i.e. litigation law, maritime law, etc.)

    // Register Attorneys to Practice Areas
       p2p_register_connection_type( array(
         'name' => 'atty_to_areas',
         'from' => 'atty',
         'to' => 'areas'
       ) );

    Practice Areas CPT

    I have registered the connection “areas_to_groups” because each Practice Area must go into one of four Practice Groups.

    // Register Practice Areas to Practice Groups
       p2p_register_connection_type( array(
         'name' => 'areas_to_groups',
         'from' => 'areas',
         'to' => 'groups'
       ) );

    Now for each attorney (attorney-single.php), I’m trying to display the following:

    Practice Groups
    – Group One
    – Group Two

    Practice Areas
    – Area One
    – Area Two

    I thought I could use nesting as described in Further Nesting section of “Using each_connected” page, but so far no luck!

    Little help?

    ref: https://wordpress.org/plugins/posts-to-posts/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How To/Should I – do a nested query to display multiple Custom Post Types’ is closed to new replies.