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' );
引用元:失念