-
-
Save robincornett/e9e39e51bafb58e99bc64ade4ee7bd7c to your computer and use it in GitHub Desktop.
Code for headings/accessibility blog post.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add Accessibility support | |
add_theme_support( 'genesis-accessibility', array( | |
'404-page', | |
'drop-down-menu', | |
'headings', | |
'rems', | |
'search-form', | |
'skip-links' | |
) ); | |
// Add screen-reader-text class to archive titles | |
add_filter( 'genesis_attr_archive-title', 'leaven_hide_archive_titles' ); | |
function leaven_hide_archive_titles( $attributes ) { | |
$attributes['class'] = 'screen-reader-text'; | |
return $attributes; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Never, never, never do it this way: */ | |
.entry-title, .archive-title, .archive-description { | |
display: none; | |
} | |
/* CSS for screen reader text support */ | |
.screen-reader-text, | |
.screen-reader-text span, | |
.screen-reader-shortcut { | |
position: absolute !important; | |
clip: rect(0, 0, 0, 0); | |
height: 1px; | |
width: 1px; | |
border: 0; | |
overflow: hidden; | |
} | |
.entry-title, .archive-title, .archive-description { | |
position: absolute !important; | |
clip: rect(0, 0, 0, 0); | |
height: 1px; | |
width: 1px; | |
border: 0; | |
overflow: hidden; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment