Support » Fixing WordPress » What is the location of these last errors?

  • I got my validation errors down from over 30 to these last two. They are both described as:

    * document type does not allow element “li” here; missing one of “ul”, “ol” start-tag *

    I understand the above description and have fixed several like this in my themes php files already.

    The problem I have with these last two is finding the actual location of the code to be fixed. Below are both of the described locations. They are not in the themes php files. I also looked at the referenced “wp-login.php” in the first one and did not see the error. The second one, I don’t have a clue where to look.

    <li><ahref=" ?action=registe
    <li><a href='' title='April 2
Viewing 8 replies - 1 through 8 (of 8 total)
  • The register link is enclosed in <li></li> tags, but there is no outer <ul></ul> tags. Try either enclosing it in the ul tags or move it up so it’s inside the previous pair.

    The second one is your archives link. It’s wrapped by <li></li> tags that are inside <li></li> tags. li tags must be inside either ul or ol tags. They can’t be inside another set of li tags.

    Hi, and thanks for the explanation. I may have to leave these two errors if I just can’t get it yet.

    Because the theme’s author had lots of this kind of error and I fixed the rest of them, I know the problem and how to fix it except…. In these last two errors, I just can not find the actual location of the code.

    For example, I figured out the code in my post above is not in any of the theme’s php files. I then saw that it may indicate that the code would be in the wp-login.php file, and I can find it there, but without the offending li tags the page source shows it wrapped with. Where do the li tags get inserted from in the page source if they are no in the wp-login file?

    I have the same issue, (finding the “li” to fix), with the other error.

    You don’t really have to worry where the li is coming from 🙂
    All you need to do – put some <ul></ul> around the code that is going to spit out the li tags and you should be OK.


    <?php wp_register(); ?>

    Thank you! I had tried that but it then told me I was missing the li tags it had complained about earlier. Wacky, where did they go if I did not take them out, only added the ul tags?

    Anyway, I did it again and the validator showed that the “li’s” were indeed gone again. So this time I took it’s word for it and added the li tags back in, leaving the ul tags I just inserted and the page validates.

    This stuff can really confound someone just learning.

    Thanks for your help!

    Hmmm. Then somebody should update the Codex:

    Default Usage

    wp_register displays the link in list format
    <?php wp_register(); ?>

    I find answers to most of my questions in the Codex. I think it is very well done and helpful. Sometimes, though, I can’t formulate search terms that turn up the Codex help I am looking for. Probably just my problem, though.

    For example, even after reading your last reply that what I was trying to figure out was in the Codex, I still could not find it. Oh well, once again, thanks to this forum, I understand a little bit more!

    Supposedly all the template Tags are listed here:

    Yes, there it is. But no search I do of the Codex turns it up. In addition to the previous searches I did, even the following don’t turn up that page or the page linked from there that actually provides the answer.

    “wp_register displays the link in list format”


    “displays the link in list format”

    Is searching the Codex only searching topics or titles or is it full text searching?

    I do now see a link at the bottom of one of the search results that says “Go To Template Tags Index”, but it was not obvious to me that is what I needed. I am not sure I would have even thought that was where I would find a link to the answer.

    Anyway, thanks again.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘What is the location of these last errors?’ is closed to new replies.