diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php
index 897e28b3c9..4ed359c770 100644
a
|
b
|
function get_custom_logo( $blog_id = 0 ) { |
976 | 976 | * If the alt attribute is not empty, there's no need to explicitly pass |
977 | 977 | * it because wp_get_attachment_image() already adds the alt attribute. |
978 | 978 | */ |
979 | | $html = sprintf( |
980 | | '<a href="%1$s" class="custom-logo-link" rel="home">%2$s</a>', |
981 | | esc_url( home_url( '/' ) ), |
982 | | wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ) |
983 | | ); |
| 979 | if ( is_home() || is_front_page() ) { |
| 980 | // If on the home or front page, don’t link the logo to home. |
| 981 | $html = wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ); |
| 982 | } else { |
| 983 | $html = sprintf( |
| 984 | '<a href="%1$s" class="custom-logo-link" rel="home">%2$s</a>', |
| 985 | esc_url( home_url( '/' ) ), |
| 986 | wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr ) |
| 987 | ); |
| 988 | } |
984 | 989 | } elseif ( is_customize_preview() ) { |
985 | 990 | // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview). |
986 | 991 | $html = sprintf( |