Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1494027

    My client hired a company to run an accessibility review and one of the items they flagged was multiple “main” areas (see https://snipboard.io/YJ8Ba1.jpg ) — looks to me like it’s really just a 2nd “main” landmark coming from my use of a footer page (example page: https://abodedev.wpengine.com/impact/housing/) (hosted on WPengine) — is there anything we can do to avoid or change that “main” in the footer page?

    Thanks and lmk if you have questions.

    #1494090

    Hey sky19er,

    Thank you for the inquiry.

    The second main element is coming from the footer page. You may need to adjust this with a custom script added to the functions.php file.

    add_action('wp_footer', function () {
        ?>
        <script>
            jQuery(document).ready(function ($) {
                var $main = $('#footer-page .container main');
    
                if ($main.length) {
                    $main.replaceWith(function () {
                        return $('<div>', {
                            html: $main.html(),
                            class: $main.attr('class'),
                            id: $main.attr('id')
                        });
                    });
                }
            });
        </script>
        <?php
    }, 999);
    

    Best regards,
    Ismael

    #1494114

    Thanks so much, Ismael, but this doesn’t seem to be working for me as-is — I dropped it in at the top of the functions.php for the child theme (https://snipboard.io/G9XSTj.jpg), but I’m still seeing two “main” landmarks (one for the footer-page) on https://abodedev.wpengine.com/about/story/ for example. Any idea what I might be doing wrong?

    #1494117

    Hi,

    Thank you for the update.

    The footer page or section is now wrapped in a div element. Please try to purge the cache before checking the page.

    fr5AYeS.md.png

    Best regards,
    Ismael

    #1494137

    Ah, sorry — I see what you’re seeing when I use the inspector, but for some reason — no matter how much I clear the cache, use different browsers, private windows, etc. — if I view the page source I still see that 2nd “main” (https://snipboard.io/ZYdU26.jpg) — is it just that the page source somehow sticks in the cache in a way I don’t understand / know how to clear?

    #1494152

    Hi,

    We checked it again today, and the footer page now contains a div element instead of main. Please try to connect to a different network and then check it again.

    Best regards,
    Ismael

    #1495202

    Ahh, apparently the issue is I’ve been viewing the page source, as opposed to checking in the inspector — the page source still shows the 2nd main, but the inspector shows the change to div. Lmk if I’m wrong about that — otherwise I think I’m set on this one and you can close the thread, thank you!

    #1495228

    Hi,

    We’re not sure what you meant by page source, but the last time we checked the footer page, it was a div element instead of a main container. Please feel free to open another thread if you have more questions.

    Have a nice day.

    Best regards,
    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘accessibility review shows multiple main landmarks’ is closed to new replies.