[Support request] W3.org validation errors

Home Forums Support [Support request] W3.org validation errors

Home Forums Support W3.org validation errors

  • This topic has 25 replies, 2 voices, and was last updated 6 years ago by Tom.
Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #523173
    Tom
    Lead Developer
    Lead Developer

    You could try, but 2.0 was a major version change, so there’s no guarantees that it will work.

    You could try adding this line to your custom functions:

    remove_filter( 'nav_menu_item_title', 'generate_dropdown_icon_to_menu_link', 10, 4 );

    #523314
    Harris

    Thanks for your assistance Tom.

    #523372
    Tom
    Lead Developer
    Lead Developer

    No problem – did that code work?

    #523428
    Harris

    I just tried the code, adding it as a snippet, but the “error” was still there.

    I also tried replacing the navigation.php file with the one of version 1.4
    The old “error” has gone, but now I am getting a new one

    Error: An element with the attribute role=button must not appear as a descendant of the a element.
    From line 134, column 155; to line 134, column 225
    <span role="button" class="dropdown-menu-toggle" aria-expanded="false"></span>

    I’m comming back on that
    with the code in the originall v2 file, altered on line 227 as follows:
    $title = $title . '<span role="main" class="dropdown-menu-toggle" aria-expanded="false"></span>';
    (changed role to “main” and totally removed “tabindex”)
    The menu seems to be working and w3 validation shows no “errors”

    Not sure though how this change might interract with the rest of the theme code or later changes to the menu layout etc.

    #523816
    Tom
    Lead Developer
    Lead Developer

    The easiest thing to do is use the current navigation.php, and remove this:

    ' . $tabindex . '

    From this line: https://github.com/tomusborne/generatepress/blob/2.0.2/inc/structure/navigation.php#L227

    #523868
    Harris

    Hello,

    The changes I made were to the current navigation.php file.

    After removing the ” . $tabindex . ” (that is what you proposed too) another “error” was produced saying

    Error: An element with the attribute role=button must not appear as a descendant of the a element.

    That’s why I also had to change the role “button” to “main” in order to bypass that error too.

    #524218
    Tom
    Lead Developer
    Lead Developer

    You can just remove the role completely – we’ll be going a different direction in the next version.

    #524259
    Harris

    I tried removing it before changing it, but it again produces an error if I remove it completely.

    Element span is missing one or more of the following attributes: role.
    From line 134, column 155; to line 134, column 212
    <span class=”dropdown-menu-toggle” aria-expanded=”false”></span>

    #524675
    Tom
    Lead Developer
    Lead Developer

    Interesting, then I suppose you need the role. In the next version, the span won’t be there anymore.

    #524715
    Harris

    It seems to be working fine now and I get no errors. So I will keep it like that untill the inspection and after that I will either update if a new version is out or I will replace with the initial file.

    Thanks for your assistance Tom!

    #525038
    Tom
    Lead Developer
    Lead Developer

    No problem!

Viewing 11 posts - 16 through 26 (of 26 total)
  • You must be logged in to reply to this topic.