Support » Plugin: Single Latest Posts Lite » W3C Validation

  • I can’t validate my page ( where I’m using this pluging and I received back this message:

    document type does not allow element “script” here; assuming missing “li” start-tag
    …iv><script type=’text/javascript’>console.log(‘2’)</script><div class=’sl…

    At a first moment, I had another issue in regards to <script> tag, because there were no type, now I fixed this, but I don’t know what I could do with this to fix the problem, because the error is saying this <script> tag shouldn’t be there (inside the

      tag) and I don’t know exactly where I should move it to.


Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jose Luis SAYAGO


    Hi, I was debugging and forgot to remove that line of code. I’ve uploaded version 1.4.1 which fixes this issue. Please update and let me know if it works.

    I’m really glad with your availability and how you help the people here.

    I just downloaded the latest version, now 1.4.2 and tried to validate, but it’s still not working well, as follow:

    document type does not allow element “div” here; assuming missing “li” start-tag
    …><div class=’slposts-ulist-pagination slp-pagination’><ul class=’page-numbers’>

    Now in place of the script tag, the div tag is the problem, because you have this structure:
    < ul > // main ul
    .< li > // post list
    .< /li> // close post list
    .< div class=’slposts-ulist-pagination slp-pagination’ > // pagination box
    ..< ul class=”page-numbers” > // pages ul
    …< li > // numbers
    …< /li > // close numbers
    ..< /ul > // close pages ul
    .< /div > // close pagination box
    < /ul> // close main ul

    And you can’t have a div tag inside the ul tag. I tried to add a object tag before the div tag, on 902 and 989 lines, but I received the same error message, but pointing to object tag as follow:

    document type does not allow element “object” here; assuming missing “li” start-tag
    … May 17, 2013</span></div><object><div class=’slposts-ulist-pagination sl…

    So what you should to do is close the “main ul” before open the “pagination box – div tag”, I guess.

    Awaiting updates…
    Thank you.

    Plugin Author Jose Luis SAYAGO


    Hello, indeed I’m aware of this validation issue when using lists. You could use for instance blocks instead of lists (setting display_type=block) then style blocks to display as lists instead of floating elements. However I’m working on improvements to the HTML nodes displaying information to avoid validation issues.

    Hello, Jose…
    ok, I guess that I found a way (I hope it does not destroy other parts):

    I only changed this:
    ‘pagination_o’ => “<div class=’slposts-ulist-pagination slp-pagination’>”,
    ‘pagination_c’ => “</div>”,

    Into this:
    ‘pagination_o’ => “<li class=’slposts-ulist-pagination slp-pagination’>”,
    ‘pagination_c’ => “</li>”,

    NOTE: you have this in two places, so it is needed to fix both.

    Here seems it works very well and has passed by validation sieve.

    Please, give me a feedback if I am on the right way.
    Thank you

    I fixed the pagination <div> validation error by specifying display_type=block but then there’s another validation error for a <link> element in the footer. To fix this, I added these 2 lines to functions.php:


    This is a great plugin, but validation errors are dangerous, especially with IE.

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