WordPress.org

Forums

Need Help with Code Validation (9 posts)

  1. nmallory
    Member
    Posted 9 years ago #

    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.

  2. moshu
    Member
    Posted 9 years ago #

    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.

  3. techwench
    Member
    Posted 9 years ago #

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

  4. nmallory
    Member
    Posted 9 years ago #

    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.

  5. nmallory
    Member
    Posted 9 years ago #

    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?

    TIA!

  6. techwench
    Member
    Posted 9 years ago #

    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.

  7. crowspeaker
    Member
    Posted 9 years ago #

    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="http://theweekendchef.exit-23.net/20050529/mushroom-wild-rice-mush/#more-97"> (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 />
    </p>
    <div class="more-link"> <a href="http://theweekendchef.exit-23.net/20050529/mushroom-wild-rice-mush/#more-97"> (more…)</a></div>
    </div>

  8. nmallory
    Member
    Posted 9 years ago #

    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.

  9. nmallory
    Member
    Posted 9 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.