Skip to content

Instantly share code, notes, and snippets.

@robincornett
Last active October 30, 2016 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robincornett/e9e39e51bafb58e99bc64ade4ee7bd7c to your computer and use it in GitHub Desktop.
Save robincornett/e9e39e51bafb58e99bc64ade4ee7bd7c to your computer and use it in GitHub Desktop.
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