[Resolved] Links do not have a discernible name

Home Forums Support [Resolved] Links do not have a discernible name

Home Forums Support Links do not have a discernible name

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1477084
    Stefan

    Lighthouse gives me a failing element <a href="#"> for the slideout-toggle because I use no toggle label.

    #1477110
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I wonder if adding an aria-label will help.

    Any chance you can link us to your site?

    #1477134
    Stefan

    sure

    #1477146
    Tom
    Lead Developer
    Lead Developer

    Try this:

    add_filter( 'generate_off_canvas_toggle_output', function() {
        $svg_icon = '';
    
        if ( function_exists( 'generate_get_svg_icon' ) ) {
            $svg_icon = generate_get_svg_icon( 'pro-menu-bars' );
        }
    
        return sprintf(
            '<span class="menu-bar-item slideout-toggle hide-on-mobile %2$s"><a href="#" aria-label="Open Off-Canvas Panel">%1$s</a></span>',
            $svg_icon,
            $svg_icon ? 'has-svg-icon' : ''
        );
    } );

    Then adjust the aria-label if needed.

    Let me know ๐Ÿ™‚

    #1477179
    Stefan

    Worked, thanks!

    #1477187
    Tom
    Lead Developer
    Lead Developer

    You’re welcome ๐Ÿ™‚

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