I'm using in single post template simple navigation below the post content:
$next_post = get_next_post();
if($next_post) {
$next_title = strip_tags(str_replace('"', '', $next_post->post_title));
echo "\t" . '<a rel="next" href="' . get_permalink($next_post->ID) . '" title="' . $next_title. '" class=" ">'. $next_title . '<i class="fa fa-chevron-right"></i></a>' . "\n";
}
and similar for get_previous_post(
). Problem is, when next (or previous) post status is future, get_next_post()
returns NULL. I simply need it working regardless of post status.