- This topic has 7 replies, 2 voices, and was last updated 3 weeks, 4 days ago by
Mantu2.
-
AuthorPosts
-
June 24, 2026 at 1:43 am #343928
Mantu2
ParticipantHi,
I am just trimming my website and Google insights cave me an small notice in Accebility tree. The test failed: Links must have discernible text. header#masthead > div.wrapper > div#mobile-header-left-menu > a#header-left-menu
So basically it is missing some text to bots and AI to use it. How can I fix this? I’m using a child theme.
June 24, 2026 at 3:59 am #343929minal
KeymasterHello @Mantu2:
Add the following CSS snippets to the additional CSS.
#header-left-menu .mobile-menu-text { display: block !important: }Go to Dashboard > Appearance > Customizer > Additional CSS then paste your code over there.
Hope it works for you.
Sincerely,
Minal
June 24, 2026 at 4:19 am #343931Mantu2
ParticipantHi,
I tried this, emptied cache, but nothing changed. I do use multisite, perhaps that have something to do with it?
June 24, 2026 at 5:33 am #343934Mantu2
ParticipantKinda worked. So. Now the same error came, but for right mobile menu. I can see MENU-text on the left menu, but right menu is missing text. I did add text
#header-right-menu .mobile-menu-text {
display: block !important;
But didn’t happen a thing.
June 24, 2026 at 5:45 am #343935minal
KeymasterHello @Mantu2:
Add the following code on your js
document.addEventListener("DOMContentLoaded", function () { document.querySelectorAll(".mobile-menu-text").forEach(function (el) { const link = el.closest("a"); if (link && !link.hasAttribute("aria-label")) { link.setAttribute("aria-label", el.textContent.trim()); } }); });Hope it works for you. And if it works, you can remove the CSS we gave you earlier.
Sincerely,
MinalJune 24, 2026 at 9:11 am #343941Mantu2
ParticipantCan you be more accurate which .js should this be put, thanks.
June 24, 2026 at 11:38 am #343946minal
KeymasterHello @Mantu2:
Sorry for the confusion,
Here is the updated code, and add it to your child theme functions.php
add_action('wp_footer', function () { ?> <script> document.addEventListener("DOMContentLoaded", function () { document.querySelectorAll(".mobile-menu-text").forEach(function (el) { const link = el.closest("a"); if (link && !link.hasAttribute("aria-label")) { link.setAttribute("aria-label", el.textContent.trim()); } }); }); </script> <?php });Sincerely,
MinalJune 24, 2026 at 3:45 pm #343953Mantu2
ParticipantThanks, that seemed to work!
-
AuthorPosts
- You must be logged in to reply to this topic.
