Skip to content

Instantly share code, notes, and snippets.

@tonyedwardspz
Created November 23, 2015 05:02
Show Gist options
  • Save tonyedwardspz/974331e00da41f510c6d to your computer and use it in GitHub Desktop.
Save tonyedwardspz/974331e00da41f510c6d to your computer and use it in GitHub Desktop.
Flip Ahead browsing
<?php
$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