Genesis 2.2 enabled child themes to opt in to enhanced accessibility features. You can check if the child theme supports any of the enhanced accessibility features or you can check if it supports a specific accessibility feature.
The Genesis function to use is
genesis_a11y. A11y is an abbreviation of accessibility.
This function can be employed as a condition that determines whether to output an accessible version or an inaccessible version of the same markup.
genesis_a11y takes one optional argument, which is a specific accessibility feature that you want to check if the theme supports. The accessibility features that a theme might support include:
By not including an argument, you will be checking whether the theme supports
genesis-accessibility at any level. Support for screen reader text is assumed at any level of theme support, so you can also check for support for screen reader text by calling up the function without an argument.
- true if the function was called without an argument and the current theme supports any
- true if the current theme supports the specified argument
- false if the current theme’s partial support of
genesis-accessibilitydoes not include the specified argument
- false if the current theme does not support
There are no filters on the output of this function.
The below example checks for screen reader support, and outputs a piece of screen reader text if the support exists.
The below example checks for support of semantic headings, to determine which version of the markup to output.
genesis_a11y has been included since version 2.2.0.
genesis_a11y is located in lib/functions/general.php.