Change/Empty Alt-text of logo
-
I use a plug-in that’s using my alt text of images for tooltips pop-ups. Unfortunately there’s an alt text inserted to the logo image automatically showing now an unnecessary popup and I can’t get rid of it. Is there a way to empty or hide the alt text from the logo?
Thank you!
Hello,
Thank you for choosing our theme and contacting us.
Try to insert this code snippet to the functions.php
file in your child-theme
and set your alt text attribute there
function basel_header_block_logo() {
$header_color_scheme = basel_get_opt( 'header_color_scheme' );
// Get the logo
$logo = BASEL_IMAGES . '/logo.png';
$logo_white = BASEL_IMAGES . '/logo-white.png';
$logo_uploaded = basel_get_opt('logo');
$logo_white_uploaded = basel_get_opt('logo-white');
if(isset($logo_white_uploaded['url']) && $logo_white_uploaded['url'] != '') {
$logo_white = $logo_white_uploaded['url'];
}
if(isset($logo_uploaded['url']) && $logo_uploaded['url'] != '') {
$logo = $logo_uploaded['url'];
}
if( $header_color_scheme == 'light' ) {
$logo = $logo_white;
}
$protocol = basel_http() . "://";
$logo = $protocol. str_replace(array('http://', 'https://'), '', $logo);
$logo_img = '<img src="' . $logo . '" alt="' . get_bloginfo( 'name' ) . '" />'
?>
<div class="site-logo">
<a href="<?php echo esc_url( home_url('/') ); ?>" rel="home">
<?php echo ( $logo_img ); ?>
</a>
</div>
<?php
}
Kind Regards
XTemos Studio
Thanks a lot, works fine!