Title: Validation error
Last modified: October 28, 2016

---

# Validation error

 *  Resolved [jseth](https://wordpress.org/support/users/jseth/)
 * (@jseth)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/validation-error-51/)
 * 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](https://wordpress.org/support/users/jseth/)
 * (@jseth)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/validation-error-51/#post-8368400)
 * 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.
 *  [Rob Myrick](https://wordpress.org/support/users/rm2773/)
 * (@rm2773)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/validation-error-51/#post-8471060)
 * 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 9 years, 8 months ago by [Rob Myrick](https://wordpress.org/support/users/rm2773/).
 *  Thread Starter [jseth](https://wordpress.org/support/users/jseth/)
 * (@jseth)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/validation-error-51/#post-8473873)
 * 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.
 *  [Rob Myrick](https://wordpress.org/support/users/rm2773/)
 * (@rm2773)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/validation-error-51/#post-8494136)
 * No problem [@jseth](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/google-language-translator/assets/icon-256x256.png?rev=3007649)
 * [Translate WordPress - Google Language Translator](https://wordpress.org/plugins/google-language-translator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-language-translator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-language-translator/)
 * [Active Topics](https://wordpress.org/support/plugin/google-language-translator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-language-translator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-language-translator/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Rob Myrick](https://wordpress.org/support/users/rm2773/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/validation-error-51/#post-8494136)
 * Status: resolved