I found this code for WordPress but it doesnt seem to work:
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');
Is there a way to make it work?
Thank you.
I’ll try with an “UP” for the last time.
Wow ten months without an answer.
1 year and 4 months without any answer, I am sorry maybe the question was too difficoult for the support forum. If that’s the case please just let me know and I will remove it.
Support is provided free by volunteers such as myself and other users. No every question gets a reply, it depends on many factors.
In essence getting to an answer would require lots of digging in the code to find, so I suspect you will not get a response.
Hi Robin, I don’t agree:
1 – paginated content is a very common feature, Google requires it and it should be native in a Forum, where it is obvious you will need it.
2 https://wordpress.org/support/topic/nothing-but-problems-4/ at each time people give bbpress a bad review, the advice is to use the support forum. Just as I did.
Bye.
not sure what you are disagreeing with in my statement, support is provided for free by volunteers such as myself (I’m nothing to do with bbpress) and you haven’t got an answer, so think that is a correct statement as well.
I’m not arguing that pagination shouldn’t be there.
Hi Robin,
I got your point, thank you for your reply: no hard feelings.
Problem is: I still have so many unuseful pages indexed by Mr Google and I don’t seem to find a way to let Google know how that content is actually organized.
Simply adding “rel next and prev” would be the easiest solution, but I have to give up since I am not a coder.
Bye