From 4803997d35c484c91e8a551461f68921960869c2 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Tue, 21 Aug 2012 12:53:54 +0000 Subject: [PATCH] When comment paging is enabled make sure to have canonical links for each of the comment pages so that all the comments are indexed instead of just the ones that are displayed on the permalink itself. Fixes #21579 props jkudish. git-svn-id: https://develop.svn.wordpress.org/trunk@21571 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/link-template.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 30e1499426..d7f7ddd7c5 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -2338,6 +2338,10 @@ function rel_canonical() { return; $link = get_permalink( $id ); + + if ( $page = get_query_var('cpage') ) + $link = get_comments_pagenum_link( $page ); + echo "\n"; }