Best Premium and Free WordPress Themes › Forums › SuperMag › Header image alt attribute (fallback option)
- This topic has 4 replies, 2 voices, and was last updated 2 years, 7 months ago by acmethemes.
-
AuthorPosts
-
October 30, 2021 at 4:50 am #99908StephenParticipant
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,
StephenOctober 31, 2021 at 4:52 pm #99924acmethemesKeymasterDear Stephen,
You will be replied soon.Best Regards!
November 1, 2021 at 8:14 am #99927acmethemesKeymasterDear Stephen,
We shall have this issue fixed in its next updated version.
Best Regards!November 2, 2021 at 8:05 pm #99950StephenParticipantThank you!
November 3, 2021 at 4:15 am #99957acmethemesKeymasterDear Stephen,
You are Most Welcome 🙂
Best Regards! -
AuthorPosts
- You must be logged in to reply to this topic.