How to add Pagination Rel link ?
-
Hey this is my website anyone know how to add pagination rel links on to header ?
There are no pagination markups.
https://dcrazed.com/
Like this
<link rel=”prev” href=”https://www.example.com/article-part1.html”>
<link rel=”next” href=”https://www.example.com/article-part3.html”>I found this function
function rel_next_prev(){
global $paged;
if (!is_singular()){
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’ );But it doesnt work either.
- The topic ‘How to add Pagination Rel link ?’ is closed to new replies.