- This topic has 5 replies, 3 voices, and was last updated 6 years, 5 months ago by
Tom.
-
AuthorPosts
-
November 20, 2019 at 11:27 am #1068934
Heather
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.
November 20, 2019 at 2:12 pm #1069208Tom
Lead DeveloperLead DeveloperHi 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?
November 22, 2019 at 7:13 am #1072603Heather
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
November 22, 2019 at 8:03 am #1072690David
StaffCustomer SupportHi 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="#">November 22, 2019 at 10:06 am #1072919Heather
Totally missed that part of the code. Thanks!
November 22, 2019 at 4:46 pm #1073228Tom
Lead DeveloperLead DeveloperGlad we could help 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.