Home Forums Basel support forum Change/Empty Alt-text of logo

Change/Empty Alt-text of logo

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #10927

    jeffoliver
    Participant

    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!

    #10931

    Artem Temos
    Keymaster

    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

    #10932

    jeffoliver
    Participant

    Thanks a lot, works fine!

    #10933

    Artem Temos
    Keymaster

    Great, you are welcome!

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)