WordPress.org

Make WordPress Core

Ticket #11694: pagination-rel-canonical.patch

File pagination-rel-canonical.patch, 709 bytes (added by joostdevalk, 10 months ago)

Patch for rel=canonical on paginated posts

  • wp-includes/link-template.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    23202320 
    23212321        $link = get_permalink( $id ); 
    23222322 
    2323         if ( $page = get_query_var('cpage') ) 
    2324                 $link = get_comments_pagenum_link( $page ); 
     2323        if ( $page = get_query_var( 'page' ) ) 
     2324                $link = trailingslashit( $link ) . user_trailingslashit( $page, 'single_paged' ); 
     2325 
     2326        if ( $cpage = get_query_var('cpage') ) 
     2327                $link = get_comments_pagenum_link( $cpage ); 
    23252328 
    23262329        echo "<link rel='canonical' href='$link' />\n"; 
    23272330}