• Resolved jseth

    (@jseth)


    I’m getting two HTML validation errors from the shortcode <?php echo do_shortcode('[google-translator]'); ?>

    Element div not allowed as child of element ul in this context. (Suppressing further errors from this subtree.) <div id="flags" class="size18"><ul id="sortable" class="ui-sortable" style="flo…

    and

    Element div not allowed as child of element ul in this context. (Suppressing further errors from this subtree.) …ited-states'></a></li></ul></div><div id="google_language_translator"></div>

    I don’t know enough to know what to change in the google-language-translator.php file, although I can find the referred text. Can you assist with this please?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jseth

    (@jseth)

    I found the problem – I had the code in the sidebar.php file, which looked nice as it put the translator at the top of each sidebar. Is there a way to use the code in a sidebar.php file? When I use it in the template files it works fine, but not in the sidebar.php file.

    Hi jseth, I think the issue might be your theme’s sidebar code. I am not sure about this, but it is common in themes to display each widget using list format, like so:

    <ul class="xoxo">
       <li class="widget-container"><!-- Translator would go here --></li>
    </ul>
    

    So if you try and place GLT in the middle of a list, then the validation error is generated.

    I’ve noticed in newer themes that they display widgets using a single <div> instead, like this:

    <div class="widget-area">
       <!-- Translator would go here -->
    </div>
    

    So obviously, this would eliminate the error you are currently receiving. Let me know if I could take a look at the webpage, maybe it will help me gain perspective.

    Thanks, Rob

    • This reply was modified 8 years ago by Rob Myrick.
    Thread Starter jseth

    (@jseth)

    What I wound up doing was to move the Google Translate to the footer area on all pages. On pages that have no sidebar, the Google Translate was in the footer area and had no error, so I just moved it there for all pages. Thanks for your reply though, if I decide to put it back in the sidebar area, I’ll give it a try.

    No problem @jseth. Stay in touch if you need any help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Validation error’ is closed to new replies.