OK...
I've got this
p2p_register_connection_type( array(
'id' => 'histoire',
'from' => 'stories',
'to' => 'webcomic',
'sortable' => 'true',
'cardinality' => 'one-to-many',
'title' => array( 'from' => 'ReliƩs', 'to' => 'Histoire' ),
)
);
and
<?php
// Collect the relevant ids
$comic_id = get_queried_object_id();
$story_id = p2p_type( 'histoire' )->get_connected( $comic_id )->posts[0]->ID;
$prev = p2p_type( 'histoire' )->get_prev( $comic_id, $story_id );
$next = p2p_type( 'histoire' )->get_next( $comic_id, $story_id );
// Display what we found
echo get_permalink( $prev );
echo get_permalink( $story_id );
echo get_permalink( $next );
?>
and an error about get_prev and get_next
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'P2P_Directed_Connection_Type' does not have a method 'get_prev' in E:\xampp\htdocs\wordpress\wp-content\plugins\posts-to-posts\core\type.php on line 86
The echo $prev and $next give me the URL of the actual post. $story_id is OK.
And I forget to say I need the link to the first post of the webcomics in previous and next story :-)