Improve Web accessibility compliance (WCAG 2.0 AA)

- Remove no-js class and fix duplicate src attribute on header image
- Use get_header_image() instead of header_image() to avoid invalid HTML
- Improve header image alt text from 'header' to 'Site header banner'
- Add screen-reader text for external links (opens in a new tab)
- Change text-align from justify to left for better readability
- Improve span.notice color contrast (red -> #a00)
- Add focus styles for keyboard navigation
- Add screen-reader-text class definitions
This commit is contained in:
2026-05-31 01:57:05 +09:00
parent 2b311fb88a
commit 7bf9a29b86
3 changed files with 43 additions and 5 deletions
+1 -1
View File
@@ -99,7 +99,7 @@
?>
<div class="header-image">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
<img src="<?php header_image(); ?>" srcset="<?php echo esc_attr( wp_get_attachment_image_srcset( get_custom_header()->attachment_id ) ); ?>" sizes="<?php echo esc_attr( $custom_header_sizes ); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="header">
<img src="<?php echo esc_url( get_header_image() ); ?>" srcset="<?php echo esc_attr( wp_get_attachment_image_srcset( get_custom_header()->attachment_id ) ); ?>" sizes="<?php echo esc_attr( $custom_header_sizes ); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php esc_attr_e( 'Site header banner', 'niu' ); ?>">
</a>
</div><!-- .header-image -->
<?php endif; // End header image check. ?>