[Plugin: Posts 2 Posts] Using P2P Results to Display Another P2P Connection
-
Having a bit of trouble displaying output.
I have three custom post types: products, brands, and distributors.
I want to be able to display distributors info on the products page(s).
My relationships are: products_to_brands and brands_to_distributors.
Any help would be appreciated, am I missing something (I don’t have too much experience with this plugin)?
$args = array( 'connected_type' => 'products_to_brands', 'connected_items' => get_queried_object() ); $connected = new WP_Query($args); while ( $connected->have_posts() ) : $connected->the_post(); $args = array( 'connected_type' => 'brands_to_distributors', 'connected_items' => get_queried_object() ); $connected = new WP_Query($args); while ( $connected->have_posts() ) : $connected->the_post(); the_title(); endwhile; endwhile;
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘[Plugin: Posts 2 Posts] Using P2P Results to Display Another P2P Connection’ is closed to new replies.