I have a blog on wordpress. I have uploaded the image and inserted my keywords in the alt tag of my logo. But it is not displaying . <a href="<?php echo esc_url( home_url( '/' ) ); ?>"> <img src="<?php echo esc_attr( $logo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" id="logo" alt="keywords"/> </a> Code (markup):
Alt-attributes are to be shown when the actual element (in this case an image) is not shown - either because it's not at the source-location, or because someone has decided to browse with images turned off. Hence, the alt-text should be descriptive of the image, so the context can be understand regardless of having the image there or not.