' . hwk_get_logo_alt() . ''; return get_custom_logo(); } /** * Filter Logo HTML */ add_filter('get_custom_logo', 'hwk_logo_filter_html'); function hwk_logo_filter_html($html){ return str_replace('itemprop="url"', 'itemprop="url" id="logo"', $html); } /** * Logo URL */ function hwk_the_logo_url(){ echo hwk_get_logo_url(); } /** * Get Logo URL */ function hwk_get_logo_url(){ if(!has_custom_logo()) return ''; $logo = wp_get_attachment_image_src(get_theme_mod('custom_logo'), 'full'); return $logo[0]; } /** * Logo ALT */ function hwk_the_logo_alt(){ echo hwk_get_logo_alt(); } /** * Get Logo ALT */ function hwk_get_logo_alt(){ if(!has_custom_logo()) return get_bloginfo('name', 'display'); $logo_id = get_theme_mod('custom_logo'); $alt = get_post_meta($logo_id, '_wp_attachment_image_alt', true); if(empty($alt)) return get_bloginfo('name', 'display'); return $alt; }