Code for headings/accessibility blog post.
<?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; | |
} |
/* 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