[Resolved] Not Able to Access Certain Links To Fix Accessibility Issue

Home Forums Support [Resolved] Not Able to Access Certain Links To Fix Accessibility Issue

Home Forums Support Not Able to Access Certain Links To Fix Accessibility Issue

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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.

    #1069208
    Tom
    Lead Developer
    Lead Developer

    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?

    #1072603
    Heather

    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

    #1072690
    David
    Staff
    Customer Support

    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="#">

    #1072919
    Heather

    Totally missed that part of the code. Thanks!

    #1073228
    Tom
    Lead Developer
    Lead Developer

    Glad we could help 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.