Archived topic
Not Able to Access Certain Links To Fix Accessibility Issue
5 replies · Started by Heather on November 20, 2019
I am trying to fix some outstanding accessibility issues with my website and there are two things that I cannot fix because I am unable to access them, so I am hoping you can tell me where or how I can fix it.
I have a burger menu wth the classes of "slideout-toggle" and "menu-item-align-right" that has an href="#". I need to add an aria-label to this, where can I access that in the files? I saw in another thread that you can add html to this in the widgets, but that did not work.
Hi there,
For the slideout toggle, you can do this (if you're using GPP 1.9.0):
add_filter( 'generate_off_canvas_toggle_output', function( $icon ) {
if ( ! function_exists( 'generate_menu_plus_get_defaults' ) ) {
return $icon;
}
$settings = wp_parse_args(
get_option( 'generate_menu_plus_settings', array() ),
generate_menu_plus_get_defaults()
);
$svg_icon = '';
if ( function_exists( 'generate_get_svg_icon' ) ) {
$svg_icon = generate_get_svg_icon( 'pro-menu-bars' );
}
return sprintf(
'<li class="slideout-toggle menu-item-align-right %2$s"><a aria-label="YOUR LABEL HERE" href="#">%1$s%3$s</a></li>',
$svg_icon,
$svg_icon ? 'has-svg-icon' : '',
'' !== $settings['off_canvas_desktop_toggle_label'] ? '<span class="off-canvas-toggle-label">' . wp_kses_post( $settings['off_canvas_desktop_toggle_label'] ) . '</span>' : ''
);
} );
The other link depends - can you link us to your site?
The website is Here. If you hover over the burger menu with your inspect tools you will see it has an href="#" when it is not active. I need to be able to add an aria-label to this for accessibility purposes. so the a tag should be something like
Hi there,
the code Tom provided which works with GPP 1.9 allows you to do that - this part of the code:
<a aria-label="YOUR LABEL HERE" href="#">
Totally missed that part of the code. Thanks!
Glad we could help :)