• I’m working on a new theme and of course I’ve got a few things put in during my trial-and-error coding that the Validator doesn’t like:

    `<div id=”hmenu”>

      <?php wp_list_pages(‘title_li=&depth=1’) ?> – <?php wp_list_bookmarks(‘title_li=&categorize=0’) ?>

    </div>`

    That dash can’t be there like that, but I want something to divide the pages from the “blogroll”. How should I ‘wrap it up’?

    Also, I get this error form W3:

    Line 398, Column 4: document type does not allow element “li” here; missing one of “ul”, “ol”, “menu”, “dir” start-tag.
    <li><a href="https://www.gangleri.nl/bookreviews">book reviews</a></li>

    And that error for every link from the “blogroll”. I did use ul, but I suppose I forgot something else (in the stylesheet perhaps?).

    There are some other errors, but I guess most of them disappear when the things above are solved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • 1. Just use a <br /> maybe.
    2. Did you close the <ul> ?

    I would have to see the generated code. I’m still not that familiar with what XHTML code WordPress generates with wp_list_pages('title_li=&depth=1') & wp_list_bookmarks('title_li=&categorize=0')

    As for the other error on Line 398;
    the code you listed is correct I would have to see the XHTML around it. You could have an error in the element directly above it.

    If I could look at the entire generated page I’ll be able to spot the error.

    There can be nothing in the CSS file that influences XHTML validation. CSS and XHTML are completely separate. XHTML defines what it is, CSS defines what it looks like. Just like putting a dress on a man doesn’t change him into a woman it only makes him look like a woman.

    NB. using inline CSS may screw-up your XHTML syntax and cause it not to validate, but then again inline CSS defeats the whole purpose of CSS so why use it?

    Thread Starter Roy

    (@gangleri)

    1. Just use a <br /> maybe.

    Well, it’s a horizontal navigation, so that’s not really an option. I think I have to put some code around the dash, but I wouldn’t know what.

    2. Did you close the
    <ul> ?

    Yes, but somehow they fell out of my code that I pasted above.

    I would have to see the generated code.

    Do you mean the source as seen in a browser? That’s:

    <div id="hmenu">
    <ul>
    <li class="page_item page-item-2"><a href="https://www.website.com/about" title="Section intro">Section intro</a>
    <li class="page_item page-item-87"><a href="https://www.website.com/articles/section-archive" title="archive">archive</a>
     -
    <li><a href="https://www.website.com/bookreviews">book reviews</a></li>
    <li><a href="https://www.website.com/filmreviews">film reviews</a></li>
    <li><a href="https://www.website.com/musicreviews">music reviews</a></li>
    <li><a href="https://www.website.com/intro">website intro & contact</a></li>
    <li><a href="https://www.website.com/news">website news & blog</a></li>
    </ul>
    </div>

    Yes I mean the source from the browser, But the whole page, not just the hmenu div. The validation error could be in an other area, somewhere above it. Do you have it running somewhere on a test server or somewhere where I can see it in action?

    Thread Starter Roy

    (@gangleri)

    It’s on five places (six actually). Here‘s one.

    Sorry for keeping you waiting.

    There are actually only 3 mistakes in the XHTML. But they throw things off so that the validator finds 10. Solve these little problems and your page will validate.

    Line 71 There’s a lost ” – ” in the menu list between section intro and articles. Just move it over inside the <li>. [ like this <li> - <a href=... ]
    Line 350 <div id="footer"> is missing the </div> at the end.
    Line 340 The link menu list in your footer have no <ul> & </ul> tags. Give the <ul> a class so you can remove the extra margin or padding the <ul> creates [ removing the <br /> in front of the top of the page link also helps ]

    That’s all!
    If you have any more questions, don’t hesitate to ask

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