-
AuthorPosts
-
June 21, 2023 at 4:31 pm #1411294
Hi, i tried to modify tabs.php in config-templatebuilder/avia-shortcodes/tabs/tabs.php moving it in child theme, using the same path but it doesn’t work.
I need to remove aria elements like aria-hidden and role=”tablist” or add them to improve my google page speed test
In this test, in Accessibility Tab, there are some errors about aria elements
https://pagespeed.web.dev/analysis/https-www-wp-assistenza-it/vdmyfzj149?form_factor=mobile
June 21, 2023 at 11:12 pm #1411319do you have entered this snippet to your child-theme functions.php ?
from docu: Link
From within your child theme, you may want to add or edit an Advanced Layout Builder element. To do so, first add the following function to your child theme’s functions.php: …
Now add a new folder in your child theme directory called shortcodes. If you copy an element from enfold>config-templatebuilder>avia-shortcodes to this folder it will replace the one in the parent and be used instead. You can also add new ones using the other shortcode elements as examples.function avia_include_shortcode_template($paths){ $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; } add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
and just put the edited alb element directly to that subfolder : shortcodes
June 28, 2023 at 4:28 pm #1411964Thanks for support, i tried with interested shortcodes and it work but i have an other problem with attribute [aria-hidden=”true”]
From this link https://pagespeed.web.dev/analysis/https-www-wp-assistenza-it/wr2w2rcfpi?form_factor=mobile in accessibilty tab, there this attribute and i want to disable or remove it
div.flex_column_table > div.flex_column > span.av_font_icon > a.av-icon-char
I can’t find it anywhere.
June 29, 2023 at 7:48 am #1412024Hi,
Thank you for the update.
We didn’t find the aria-hidden attribute when we inspect the icon element. Did you manage to remove the attribute? If not, you can try this code in the functions.php file.
function ava_custom_script() { ?> <script> (function($) { $(document).ready(function() { $('#top .av_font_icon. a').removeAttr('aria-hidden'); }); }(jQuery)); </script> <?php } add_action('wp_footer', 'ava_custom_script');
Please make sure to purge the cache before testing the page.
Best regards,
IsmaelJune 29, 2023 at 10:52 am #1412049please see now…i inserted the function but it doesn’t work
June 29, 2023 at 11:04 am #1412054Where do you load your jQuery ( see options page of enfold : Performance – “Load jQuery In Your Footer”
if you do load it in the footer maybe a priority to that add_action solves the problem:replace that one line to
add_action('wp_footer', 'ava_custom_script', 999);
Edit: PS forget it – i see that the code above has an additional dot – remove that dot after av_font_icon :
function ava_custom_script() { ?> <script> (function($){ $(document).ready(function() { $('#top .av_font_icon a').removeAttr('aria-hidden'); }); }(jQuery)); </script> <?php } add_action('wp_footer', 'ava_custom_script');
June 30, 2023 at 3:25 pm #1412176So i inserted this function on functions.php
function ava_custom_script() {
?>
<script>
(function($){
$(document).ready(function() {
$(‘#top .av_font_icon a’).removeAttr(‘aria-hidden’);
});
})(jQuery);
</script>
<?php
}
add_action(‘wp_footer’, ‘ava_custom_script’, 999);Is it correct?
July 1, 2023 at 4:27 am #1412200priority (999) may not be necessary – only if you load your jQuery in the footer.
everything is said on the answer here: https://kriesi.at/support/topic/modify-shortcodes/#post-1412054
One thing to note is that the name of the function (ava_custom_script) is often used on the forum here – so I prefer to choose a meaningful name; one that immediately says what is being achieved.
Also, the child theme functions.php will resent a repeated occurrence of the function name – and report an error. Function names must be unique.function remove_aria_hidden_attribute() { ?> <script> (function($){ $(document).ready(function() { $('#top .av_font_icon a').removeAttr('aria-hidden'); }); }(jQuery)); </script> <?php } add_action('wp_footer', 'remove_aria_hidden_attribute');
July 4, 2023 at 6:15 pm #1412447it doesn’t work because Google Page Speed tests before this function removes the aria-hidden attribute
July 4, 2023 at 8:12 pm #1412457Contrary to my opinion that these settlements make sense, I tried to find a solution. Now, unfortunately, I have to throw in the towel. No idea how I could turn this off.
Adding aria-hidden=”true” to the icon hides the icon character from being included in the accessible name.
This is part of WAI-ARIA roles and i do not know why Google has a problem with it.However, the mistake is that they contain focusable descendants.
i read something about giving to those decendents an attribute: tabindex=”-1″ -
AuthorPosts
- You must be logged in to reply to this topic.