• Does anyone know why the wp_get_archives function is generating invalid XHTML?

    You can see my site here: https://www.construction.freshpages.org

    This comment generated invalid XHTML:

    <ul><?php wp_get_archives('type=postbypost&limit=5&format=custom'); ?></ul>
    This doesn’t:

    <?php wp_get_archives('type=postbypost&limit=5&format=custom'); ?>

    My problem is, I need the links in a list, so I need the ul function. This should be allowed under XHTML?.. does anyone know how to solve this??

    Thanks,
    -Ryan

Viewing 2 replies - 1 through 2 (of 2 total)
  • not sure, but my site is fully valid, and i use the following

    <ul><li><h3>Archives</h3>
    <ul>
    <?php wp_get_archives('type=monthly'); ?>
    </ul>
    </li></ul>

    so basically the list is a sub list of my whole sidebar.

    so the problem might have been that your last sidebar item ended with </li> and then you tried to open the <ul> straight after, but because it is a list within a list(i assume) it needs to be opened with <li>

    hope this points you in the right direction, otherwise use the validator with the show source option, and it will tell you where the error is, and give a description.

    It’s not the <ul> tags that’s the problem; it’s the incorrect use of the <script> tag by WordPress. WP writes out the following:

    <script lang='javascript'>&hellip'</script>

    which is invalid, instead of using the value:

    type="text/javascript"

    like you’re supposed to (according to W3C).

    This is particularly irritating, and I, for one, would like to see it fixed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp_get_archives – Generates invalid XHTML?’ is closed to new replies.