Making WordPress.org

Changeset 9246


Ignore:
Timestamp:
11/01/2019 02:59:59 AM (4 years ago)
Author:
tellyworth
Message:

Breathe: improve rel=canonical meta

Fixes #4799

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php

    r9207 r9246  
    6767function rel_canonical() {
    6868    $canonical = false;
    69 
    70     if ( is_front_page() ) {
     69    $queried_object = get_queried_object();
     70
     71    if ( is_tax() || is_tag() || is_category() ) {
     72        $canonical = get_term_link( $queried_object );
     73    } elseif ( is_singular() ) {
     74        $canonical = get_permalink( $queried_object );
     75    } elseif ( is_front_page() ) {
    7176        $canonical = home_url( '/' );
    7277    }
Note: See TracChangeset for help on using the changeset viewer.