WordPress.org

Forums

xhtml validation (7 posts)

  1. dtclarinet
    Member
    Posted 10 years ago #

    What is the advantage of having valid code? Is it possible in a blog?

    I've tried to clean things up. But there's code that wp writes for categories which won't validate. Here is one error---

    Line 362, column 19: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag

    <li id="linkcat-3"><h2>Favorites</h2>

    Plus, when I use blockquotes in a post, it doesn't validate. (I'm even using a plugin called x-valid)

    Please advise.
    David

  2. Mark (podz)
    Support Maven
    Posted 10 years ago #

    If you could give us a link to your site it would be easier ...

    And the advantage ? Apart from it rendering as it should and being lovely to crawl if you are a search-bot ? A smug grin :)

  3. dtclarinet
    Member
    Posted 10 years ago #

    http://glitteringstew.com/muse

    Thanks for any suggestions.
    David

  4. dtclarinet
    Member
    Posted 10 years ago #

    Anybody have any idea why wp code for link categories created in wp-admin would cause xhtml errors??

    The error above is one of several, one for each category.

    Where are the files that have this info? Should I try to edit them (when i find them)?

  5. Kafkaesqui

    Posted 10 years ago #

    http://webdesign.about.com/od/beginningtutorials/l/bltags_li.htm

    valid context
    The <li> tag is valid within the following tags:
    dir, menu, ol, ul

    Basically, you're using <li> tags for your headers outside a valid element. For the sidebar, this is usually <ul>.

  6. dtclarinet
    Member
    Posted 10 years ago #

    <h2><?php _e('Meta'); ?></h2>
    <ul>
    <li><?php wp_loginout(); ?>
    <li><?php wp_register(); ?>
    </li>
    <li><a href="http://validator.w3.org/check/referer" title="<?php _e('This page validates as XHTML 1.0 Transitional'); ?>"><?php _e('Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr>'); ?></a></li>
    <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
    <li><a href="http://wordpress.org/" title="<?php _e('Powered by WordPress, state-of-the-art semantic personal publishing platform.'); ?>">WordPress</a></li>
    <?php wp_meta(); ?>
    </ul>

    And if I add the closing li tags in the first two php lines, a third ghost line is created in the blog, and I still get code errors

  7. vkaryl
    Member
    Posted 10 years ago #

    You only need one closing tag in the first php line, there's already a closer after the second line.

Topic Closed

This topic has been closed to new replies.

About this Topic