$custom_logo_id =
get_theme_mod( 'custom_logo'
);
// We have a logo. Logo is go.
if ( $custom_logo_id ) { $custom_logo_attr = array
( 'class' => 'custom-logo',
'loading' => false,
);
$unlink_homepage_logo =
(bool) get_theme_support( 'custom-logo', 'unlink-homepage-logo'
);
if ( $unlink_homepage_logo &&
is_front_page() && !
is_paged() ) { /*
* If on the home page, set the logo alt attribute to an empty string,
* as the image is decorative and doesn't need its purpose to be described.
*/
$custom_logo_attr['alt'
] = '';
} else { /*
* If the logo alt attribute is empty, get the site title and explicitly pass it
* to the attributes used by wp_get_attachment_image().
*/
$image_alt =
get_post_meta( $custom_logo_id, '_wp_attachment_image_alt', true
);