rel=prev & rel=next

Posted in: Newsmag
Post count: 217

Hi,

how can I add the rel=”prev” and rel=”next” attributes to my static front page pagination?

The following code is working with categorys and tags, but not on my front page. It refuses to show the rel=”next”. http://www.promicabana.de

function cor_rel_next_prev_pagination() {
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
}
}
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
add_action('wp_head', 'cor_rel_next_prev_pagination');

Thanks!

Post count: 6535

Hi

We use a custom function to generate the pagination for pages and you have to modify it to apply that attributes on next/prec buttons. The function is located in td_page_generator.php here: http://screencast.com/t/coAR6MeOKP0V

Thanks!

Post count: 217

Hi Andrei,

thanks for your answer! 🙂 And could you tell me please, what I have to change/add?

Thank you!

Post count: 6535

Hi

Unfortunately we can offer customizations services at theme moment so if you still need guidance on this or you’re not aware of the steps you need to take in this regard my advice is to look for someone who can help you with implementation or consider hiring a developer or a freelancer to do this for you.

Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.