Tagged: Duplicate ID
-
AuthorPosts
-
July 15, 2024 at 8:20 pm #1462114
Working on a site for Accessibility standards. When using the W3 Validator and keep getting errors I want to get rid of. I need help with the following.
Duplicate id – the same ID is used on more than one element.
id=aviaPrivacyGoogleWebfontsDisabled id=aviaPrivacyGoogleWebfontsDisabled id=aviaPrivacyGoogleMapsDisabled id=aviaPrivacyGoogleMapsDisabled id=aviaPrivacyVideoEmbedsDisabledThe banner role is unnecessary for element header.
The navigation role is unnecessary for element nav.Is there a way to get rid of these errors and warnings?
Regards
NinaJuly 16, 2024 at 8:02 am #1462130Hey Advantage09,
Thank you for the inquiry.
Did you manually add a privacy toggle inside a tab section? This causes duplicate IDs for these elements:
id=aviaPrivacyGoogleWebfontsDisabled id=aviaPrivacyGoogleWebfontsDisabled id=aviaPrivacyGoogleMapsDisabled id=aviaPrivacyGoogleMapsDisabled id=aviaPrivacyVideoEmbedsDisabled
Although it is not necessary, if you want to remove the role attributes from certain elements, you can use this script:
function ava_remove_roles_script() { ?> <script> (function ($) { function g() { $('#header').removeAttr('role'); $('.main_menu').removeAttr('role'); } $(document).ready(function () { g(); }); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_remove_roles_script');
Best regards,
IsmaelJuly 16, 2024 at 8:04 am #1462131Hi,
Duplicate id – the same ID is used on more than one element.
id=aviaPrivacyGoogleWebfontsDisabled id=aviaPrivacyGoogleWebfontsDisabled id=aviaPrivacyGoogleMapsDisabled id=aviaPrivacyGoogleMapsDisabled id=aviaPrivacyVideoEmbedsDisabledUPDATE: Tabs 3 and 4 of the privacy modal popup window contain the same privacy toggles. Did you configure this?
Best regards,
IsmaelJuly 16, 2024 at 4:45 pm #1462169Thanks for your reply.
The function for removing roles did not do anything unfortunately.
And as for the duplicate ID, I have not configured anything. Except for translating the text to Norwegian it is right out of the box. I checked it side by side with another website that is identical in setting up the privacy and cookie section, and there are not duplicate ID issues with the other site.Regards
NinaJuly 17, 2024 at 7:38 am #1462219Hi,
Thank you for the update.
Please check the privacy modal and look at tabs 3 and 4. You’ll find the same privacy toggles in both tabs. Please remove the duplicate toggles or remove the entire tab in the Enfold > Privacy & Cookies > Cookie Handling > Modal Popup Window section.
The script above removes the role attribute from the specified elements:
Header:
<header id="header" class="all_colors header_color light_bg_color av_header_top av_logo_left av_main_nav_header av_menu_right av_custom av_header_sticky av_header_shrinking av_header_stretch_disabled av_mobile_menu_phone av_header_transparency av_header_glassy av_header_searchicon_disabled av_header_unstick_top av_seperator_small_border av_bottom_nav_disabled av_alternate_logo_active" data-av_shrink_factor="50" itemscope="itemscope" itemtype="https://schema.org/WPHeader" style="margin-top: 0px;">
Menu:
<nav class="main_menu" data-selectname="Velg en side" itemscope="itemscope" itemtype="https://schema.org/SiteNavigationElement"> <div class="avia-menu av-main-nav-wrap"> <ul role="menu" class="menu av-main-nav" id="avia-menu"> </nav>
If you want to remove this manually from the template, edit the enfold/includes/helper-main-menu.php file and remove the avia_markup_helper function around line 213:
$main_nav = "<nav class='main_menu' data-selectname='" . __( 'Select a page', 'avia_framework' ) . "' " . avia_markup_helper( array( 'context' => 'nav', 'echo' => false ) ) . '>';
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.