8 replies
Hey Gang,

I put a text widget in my wordpress sidebar to build links...but I am having a problem when I validate it with W3C validation service... It is returning the following error and I can't figure out how to fix it...
Line 173, Column 49: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag

<li id="pages-3" class="widget widget_pages"><h2>Home Page</h2>
--------------------------------
Here is the code format that i am putting into my sidebar widget.

<ul>
<li><a href="http://blahblahblah.com/blah.php" rel="nofollow" target="_blank">blah blah</a></li>
<li><a href="http://boogelywoogely.com/boogely.php" rel="nofollow" target="_blank">boogely Woo</a></li>
<li><a href="http://wombambaloobop.com/wombamboo.php" rel="nofollow" target="_blank">ding de dong</a></li>
</ul>

===> of course these are not my actually links & websites.... Just wanna make people smile!

just wondering what I'm missing, and/or what I'm doing wrong?

In Many Thanks,
tom
#code #dilemma #li code #sidebar #ur code
  • I validated the code as you have entered in here in the forum.

    I can tell you that the quotes around the nofollow is incorrect. These are special microsoft style quotations that break html.

    Do you see the difference between the quotes around the nofollow and the rest of the quotes in the string?

    As for the error you reported above ...
    document type does not allow

    The key word is document type. Try setting the doc type to XHTML 1.0 Transitional.

    This information was not included in your post, so I have no idea what the current doc type is set to.
    {{ DiscussionBoard.errors[3616761].message }}
    • Profile picture of the author tomfinster
      AH Man Thanks You SOOOO Much!!! Good eye in detecting this.

      This was absolutely driving me nuts... Well, I guess that's the price you pay for doing a copy & paste with HTML code.

      I'm not good would HTML, so I would of never noticed that those quotes would have made a difference.

      Once again,
      Thanks You So Much!

      Tommy
      Signature

      Some Of The Top Affiliate Courses In The Industry!

      {{ DiscussionBoard.errors[3617127].message }}
      • Profile picture of the author tomfinster
        Ok, fixed that problem, but I just realized that the next line has an error that i also can't figure out.... here is the msg ===>

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

        <li id="pages-3" class="widget widget_pages"><h2>Home Page</h2> <ul>
        Signature

        Some Of The Top Affiliate Courses In The Industry!

        {{ DiscussionBoard.errors[3617506].message }}
        • Profile picture of the author caesargus
          Originally Posted by Tom Pregon View Post

          Ok, fixed that problem, but I just realized that the next line has an error that i also can't figure out.... here is the msg ===>

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

          <li id="pages-3" class="widget widget_pages"><h2>Home Page</h2> <ul>
          Hi Tom,

          without seeing the rest of your code, it appears that the <li> element does not close, nor does it have the needed <ul> element before it. - you can change it to a <p> or a <div>
          <div id="pages-3" class="widget widget_pages"><h2>Home Page</h2> </div>

          But I'm sure you have some other structure that you are trying to use.

          if you post the code surrounding the error, that may give us more of an idea of what's going on.
          {{ DiscussionBoard.errors[3619240].message }}
          • Profile picture of the author tomfinster
            Originally Posted by caesargus View Post

            Hi Tom,

            without seeing the rest of your code, it appears that the <li> element does not close, nor does it have the needed <ul> element before it. - you can change it to a <p> or a <div>
            <div id="pages-3" class="widget widget_pages"><h2>Home Page</h2> </div>

            But I'm sure you have some other structure that you are trying to use.

            if you post the code surrounding the error, that may give us more of an idea of what's going on.
            It's the same exact code I posted above in the first post when starting this thread which is th following ...

            Here is the code format that i am putting into my sidebar widget.

            <ul>
            <li><a href="http://testsite.com/test.php" rel="nofollow" target="_blank">blah</a></li>
            <li><a href="http://testsite2.com/test2.php" rel="nofollow" target="_blank">blah blah</a></li>
            <li><a href="http://testsite3.com/test3.php" rel="nofollow" target="_blank">blah blah blah</a></li>
            </ul>

            Now, just so you know -- this code I am placing within my sidebar text module widget?

            My original problem was with the special microsoft style quotations which I just fixed, but i am still getting errors with W3C validation service...

            So, now am I missing code before it -or- after it?

            Like, do I have to put this code within <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">....

            ....and/or also within <html> and <body> tags?

            Or, is it some other problem entirely?

            I also went to my page to view page source and copied lines 174, 175, 176 & 177 -- which gave me the following ===>

            <div id="sidebar-left">
            <li id="pages-4" class="widget widget_pages"><h2>Home Page</h2> <ul>

            <li class="page_item page-item-5 current_page_item"><a href="http://mywebsite.com/" title="Blah Blah Blah – Blah Blah Blah">Blah Blah Blah</a></li> </ul>

            So, this looks like the <ul> code is outside the <li> code, but Is this a bug within my flexsqueeze theme, or within wordpress? And how & where do I fix it?

            In Many Thanks!
            Tommy


            In Many Thanks,
            Tom
            Signature

            Some Of The Top Affiliate Courses In The Industry!

            {{ DiscussionBoard.errors[3619872].message }}
            • Profile picture of the author caesargus
              Originally Posted by Tom Pregon View Post

              It's the same exact code I posted above in the first post when starting this thread which is th following ...

              Here is the code format that i am putting into my sidebar widget.

              <ul>
              <li><a href="http://testsite.com/test.php" rel="nofollow" target="_blank">blah</a></li>
              <li><a href="http://testsite2.com/test2.php" rel="nofollow" target="_blank">blah blah</a></li>
              <li><a href="http://testsite3.com/test3.php" rel="nofollow" target="_blank">blah blah blah</a></li>
              </ul>

              Now, just so you know -- this code I am placing within my sidebar text module widget?

              My original problem was with the special microsoft style quotations which I just fixed, but i am still getting errors with W3C validation service...

              So, now am I missing code before it -or- after it?

              Like, do I have to put this code within <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">....

              ....and/or also within <html> and <body> tags?

              Or, is it some other problem entirely?

              I also went to my page to view page source and copied lines 174, 175, 176 & 177 -- which gave me the following ===>

              <div id="sidebar-left">
              <li id="pages-4" class="widget widget_pages"><h2>Home Page</h2> <ul>

              <li class="page_item page-item-5 current_page_item"><a href="http://mywebsite.com/" title="Blah Blah Blah - Blah Blah Blah">Blah Blah Blah</a></li> </ul>

              So, this looks like the <ul> code is outside the <li> code, but Is this a bug within my flexsqueeze theme, or within wordpress? And how & where do I fix it?

              In Many Thanks!
              Tommy


              In Many Thanks,
              Tom
              This sounds like a completely different issue than what you originally posted about. Same type of issue, but different. So yes, the UL is out of order with your LI - if this is an issue with your theme, there is a spot in Wordpress that will allow you to edit the template (Appearance -> Editor and select the file that appears to be messing up).

              You should be able to make adjustments there.

              Good luck
              {{ DiscussionBoard.errors[3622658].message }}
  • This is an issue with some other part of your website, not just what you are putting into your widget.

    I have the code above in a file all by its self here ...
    Untitled Document
    It validates perfectly.
    [Valid] Markup Validation of http://freelinkcloaker.com/test.html - W3C Markup Validator

    We cant help if you dont provide a url or anything.
    {{ DiscussionBoard.errors[3622685].message }}
    • Profile picture of the author tomfinster
      Thanks guys,

      I contacted flexsueeze theme service and they said I have the old version and that I need to upgrade to fix these issues.

      In Many Thanks!
      Signature

      Some Of The Top Affiliate Courses In The Industry!

      {{ DiscussionBoard.errors[3623610].message }}

Trending Topics