Skip to content

Instantly share code, notes, and snippets.

@MxAshUp
Created December 29, 2014 16:45
Show Gist options
  • Save MxAshUp/7574840e9fb8017ca3aa to your computer and use it in GitHub Desktop.
Save MxAshUp/7574840e9fb8017ca3aa to your computer and use it in GitHub Desktop.
<?php
if(is_archive()) {
function rel_next_prev(){
global $paged;
if ( get_previous_posts_link() ) { ?>
<link rel="prev" href="<?php echo get_pagenum_link( $paged - 1 ); ?>" /><?php
}
if ( get_next_posts_link() ) { ?>
<link rel="next" href="<?php echo get_pagenum_link( $paged +1 ); ?>" /><?php
}
}
add_action( 'wp_head', 'rel_next_prev' );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment