• Resolved Stefanie

    (@focusorganic)


    I checked the validation before applying sidebar widgets, and it validated with no errors or warnings. When I add any sidebar widgets (the regular archive, categories, etc.), the site not longer validates. I get this error:

    document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag

    I have searched and found that this means I have an li tag not within a ul tag, but I have checked and found none that seem to be miscoded. Here is the section of source code it says is causing the error:

    #
    # <div id="sidebar1">
    #
    # <li id="archives" class="widget widget_archives"><h2 class="widgettitle">Archives</h2>
    # <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value="">Select Month</option> <option value='https://focusorganic.com/wp/2008/01/'> January 2008 </option>
    # <option value='https://focusorganic.com/wp/2007/12/'> December 2007 </option>
    # </select>
    # </li>
    # </div> <!-- [sidebar1] -->

    Specifically, line 502.

    As it is now, I’ve only put one widget in the sidebar while I am trying to fix this problem. A page showing this problem can be seen here: https://focusorganic.com/wp/testest/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Stefanie

    (@focusorganic)

    I apologize, line 502 is this one:

    <li id="archives" class="widget widget_archives"><h2 class="widgettitle">Archives</h2>

    It is an issue with my theme, as I have tried the default theme and there is no problem, but I cannot seem to figure out what is wrong with the theme. I have gone through every theme specific page and have not found any improper LI tags…

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    The theme is configured incorrectly for widgets. Post your functions.php file and your sidebar.php file over at https://wordpress.pastebin.ca and post the links back here, so people can tell you how to correct them.

    Thread Starter Stefanie

    (@focusorganic)

    SOLVED!!! Added UL opening tag right after <div id="sidebar1"> and UL closing tag right before </div> <!-- [sidebar1] --> in sidebar.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Activating sidebar widgets causes xhtml to not validate’ is closed to new replies.