- This topic has 25 replies, 2 voices, and was last updated 6 years ago by Tom.
-
AuthorPosts
-
March 18, 2018 at 11:52 am #523173TomLead DeveloperLead 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 );
March 18, 2018 at 4:59 pm #523314HarrisThanks for your assistance Tom.
March 18, 2018 at 9:24 pm #523372TomLead DeveloperLead DeveloperNo problem – did that code work?
March 19, 2018 at 12:24 am #523428HarrisI 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 oneError: 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.
March 19, 2018 at 9:57 am #523816TomLead DeveloperLead DeveloperThe 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
March 19, 2018 at 10:49 am #523868HarrisHello,
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.
March 19, 2018 at 8:32 pm #524218TomLead DeveloperLead DeveloperYou can just remove the role completely – we’ll be going a different direction in the next version.
March 19, 2018 at 10:03 pm #524259HarrisI 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>March 20, 2018 at 9:42 am #524675TomLead DeveloperLead DeveloperInteresting, then I suppose you need the role. In the next version, the span won’t be there anymore.
March 20, 2018 at 10:22 am #524715HarrisIt 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!
March 20, 2018 at 8:20 pm #525038TomLead DeveloperLead DeveloperNo problem!
-
AuthorPosts
- You must be logged in to reply to this topic.