Support » Fixing WordPress » Need Help with Code Validation

  • O.K. Thanks to a nice person who adviced me to check out my code through a validation site (actually she nicely provided the link), I have fixed most of the invalid code. However, there are 10 left which perplex me. The messages all appear to indicate that my ordered and unordered lists are “in the wrong places” and also the divs for the excerpt reloaded plug-in.

    The validation is here

    The website is The Weekend Chef.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Did you try to check the box “Show Source” on the validation page and hit the Revalidate button? It will show you exactly where the mistakes/errors are.

    Your<ul><li> are inside the <p> tags. That’s what it’s complaining about. They have to be outside the <p> tags.

    OK How do I get them out of the <p> tags? WordPress appears to be adding them it by it’s lonesome. These ordered and unordered lists are in posts I wrote.

    Hmmm…I replied to this but it seems to have disappeared.

    I managed to get the lists sorted out. It had to do with the Textile 1.0 plug-in and I had to deactivate it and then edit all the posts I’d written since I turned it on.

    The issue with the <div> remains and appears to be the result of the_excerpt_reloaded which apparently is “fixing” the unclosed tags after the <div> instead of before it and therefore it makes the page XHTML invalid. 🙁 Anyone know how to resolve this?


    I wonder if it’s the excerpt plugin or WP itself?

    Check in Admin >> Options >> Writing

    And see if the “WordPress should correct invalidly nested XHTML automatically” box is checked. If it is, uncheck it.

    In your template source, you need to move the </p> tag before the div the styles your “more”. You’re not supposed to put div between p tags.

    So this

    <p><em>Suggested Variation</em><br />
    For something a little more soupy, add another cup or two<br />
    <div class="more-link"> <a href=""> (more…)</a></div>
    </p> </div>

    should look like this:

    <p><em>Suggested Variation</em><br />
    For something a little more soupy, add another cup or two<br />
    <div class="more-link"> <a href=""> (more…)</a></div>

    Crowspeaker – I realize that. However, it’s the_excerpt_reloaded() plugging which is not writting the closing out tags before the div that is causing the problem.

    techwench – I tried unclicking that option and got 23 errors instead of 5.

    I also tried moving the code in the plug in that does the balanceTags() to before it adds the “more” link but that resulted in no closing tags being written and 23 errors as well.

    In case anyone wants to know how to fix this in the future:

    Open the-excerpt-reloaded.php file in your plugins directory and find this line:
    $excerpt .= "<div class=\"more-link\"> <a href=\"". get_permalink() . "#more-$id\">$more_link_text</a></div>";

    and change it to:
    `$excerpt .= "<span class=\"more-link\"> $more_link_text</span>";'

    The drawback is that it doesn’t put the more link text on a new line, but you might be able to add a
    before the <span> to resolve that if you need to.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Need Help with Code Validation’ is closed to new replies.