Get_Adjacent_Post WordPress

$prev_post = get_adjacent_post();
if( $prev_post )
 echo '<a href="'. get_permalink($prev_post->ID) .'">'. $prev_post->post_title .'</a>';

Leave a Comment