Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Flip Ahead browsing
$single = (is_single() ? TRUE : FALSE);
if ($single){
$prevPost = get_previous_post();
if (!empty( $prevPost )){ ?>
<link rel="prev" href="<?php echo get_permalink($prevPost->ID); ?>"/>
<?php }
$nextPost = get_next_post();
if (!empty( $nextPost )) { ?>
<link rel="next" href="<?php echo get_permalink($nextPost->ID); ?>"/>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.