How To/Should I – do a nested query to display multiple Custom Post Types
-
I have 3 Custom Post Types
1. Attorneys
2. Practice Areas
3. Practice GroupsAttorneys 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 TwoPractice Areas
– Area One
– Area TwoI thought I could use nesting as described in Further Nesting section of “Using each_connected” page, but so far no luck!
Little help?
- The topic ‘How To/Should I – do a nested query to display multiple Custom Post Types’ is closed to new replies.