• adamito

    (@adamito)


    Hi,

    I use Posts 2 Posts to build an educational plateform.

    The connection is between “contenu” and “branche” :

    p2p_register_connection_type( array(
    ‘name’ => ‘contenu_to_branche’,
    ‘from’ => ‘contenu’,
    ‘to’ => ‘branche’,
    ‘cardinality’ => ‘many-to-many’,
    ‘reciprocal’ => true,
    ‘title’ => array( ‘from’ => ‘Branche’, ‘to’ => ‘Contenus de la branche’ )
    ) );

    On “contenu” can be connected to many “branche”

    My problem is duplicated posts in a query :

    $args = array(
    ‘connected_type’ => ‘contenu_to_branche’,
    ‘connected_items’ => $branches,
    ‘nopaging’ => false,
    ‘post_type’ => ‘contenu’,
    ‘posts_per_page’ => 10,
    ‘order’ => ‘DESC’,
    ‘orderby’ => ‘ID’,
    );

    $branches is an array that contain ids of “branches”.

    The issue is that i get the same “contenu” many times, because it’s connected to many “branche”.

    Is there any solution ?

    Regards

    http://ww.wp.xz.cn/extend/plugins/posts-to-posts/

The topic ‘Duplicate post problem’ is closed to new replies.