Header image alt attribute (fallback option) - Acme Themes

Best Premium and Free WordPress Themes Forums SuperMag Header image alt attribute (fallback option)

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #99908
    Stephen
    Participant

    Hi,

    The WordPress core function for header images currently sets the alt attribute to the site name, yet it likely will change soon (WP 5.9). Then users can set their own custom text, or else the alt attribute would be empty. This should be an improvement except when those images are linked and users do not define the custom text. A directory search found four themes that can add a link on that image through the ‘get_header_image_tag’ filter, including Online Shop, SuperMag and SuperNews.

    Could you edit the header image filters in your themes to provide a fallback when those images are linked? The function could have something like this (in SuperMag, it’s supermag\acmethemes\functions\header.php):

    
    	if ( !empty( $supermag_header_image_link)) {
    		$target = "";
    		if( 1 == $supermag_header_image_link_new_tab ){
    			$target = 'target = _blank';
    		}
    		$output .= '<a '.esc_attr( $target ) .' href="'.esc_url( $supermag_header_image_link ).'" title="'.esc_attr( get_bloginfo( 'name', 'display' ) ).'" rel="home">';
    		$output .= str_replace( 'alt=""', 'alt="'.esc_attr( get_bloginfo( 'name', 'display' ) ).'"', $html );
    		$output .= ' </a>';
    	} else {
    		$output .= $html;
    	}
    

    Thank you,
    Stephen

    #99924
    acmethemes
    Keymaster

    Dear Stephen,
    You will be replied soon.

    Best Regards!

    #99927
    acmethemes
    Keymaster

    Dear Stephen,
    We shall have this issue fixed in its next updated version.
    Best Regards!

    #99950
    Stephen
    Participant

    Thank you!

    #99957
    acmethemes
    Keymaster

    Dear Stephen,
    You are Most Welcome 🙂
    Best Regards!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.