Hello,
I put the code below in the child functions.php but I don’t understand the displaying order.
Ideally, I would like an order with date, in the same pages of a parent page. Possible?
Thanks so much
add_action( 'the_content', 'add_next_post_item_link' );
function add_next_post_item_link ( $content ) {
if ( is_singular('page') ) {
$next_name = '<span>Page suivante</span><br/> ' . get_the_title( get_next_post()->ID );
$prev_name = '<span>Page précédente</span><br/> ' . get_the_title( get_previous_post()->ID );
$next_link = get_next_post() ? '<a class="prev" href="' . get_permalink( get_next_post()->ID ) . '">' . $prev_name . '</a>' : '';
$prev_link = get_previous_post() ? '<a class="next" href="' . get_permalink( get_previous_post()->ID ) . '">' . $next_name . '</a>' : '';
$posts = '<div class="wp-post-navigation-next">'.$next_link.$prev_link.'</div>';
return $content . $posts;
} else {
return $content;
}
}