Support » Themes and Templates » Please help me to validate! (Tell php to use CSS)

  • Resolved Bobworth


    Hey Guys! First I wanted to wait until my site is finished until I tell you how easy it was and how amazing I find WordPress to be. Well, of course I still do, so my thanks to those involved. Awesome Job!

    Now. I got every page to validate (through tidy). I don’t quite know how I did it but it worked. (I had to insert divs etc where they make absolutely no sense to me.) And that’s pretty much the point: I don’t know what I do, I just do it – works out about half the time. : )

    Then there’s this one page I copied together from bits of php from this very board and the existing php files. It lists the recent 2000 posts (=all) and only displays the titles. For easy, imagefree browsing.

    Here is the entire code of the template used, it validates:

    <?php get_header(); ?>
    <div id="content" class="narrowcolumn">
    <h2 class="pagetitle">List of 'Everything'</h2>
    <ul><?php get_archives('postbypost', 2000); ?></ul>
    <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    <?php get_sidebar(); ?>

    Thing is: as soon as I try to format the list with css (I adjusted ‘h6’ for this purpose) I get AT LEAST 6 WARNINGS. (Missing /h6, missing /div, inserting implicit ul, missing /ul, trimming empty h6,…)

    It should look like this:
    <h6><?php get_archives('postbypost', 2000); ?></h6>

    How do I tell the browser to interpret the results of ‘get_archives(‘postbypost’)’ as defined in h6 (and NOT as bulleted list)?! The right way!?
    h6 already features list-style-type:none but as soon as I remove the

      all hell breaks loose.

    Somebody with basic CSS knowledge should get around this fairly quickly, I figured, so here it goes – my first post.

    THANK YOU for your time! Yay WordPress!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Try this

    <?php wp_get_archives('type=postbypost&limit=2000&format=custom&before=<h6>&after=</h6>'); ?>


    Wow it got posted after all! What a nice suprise, incl. solution!

    Ok Jeremy, this works great! Validates and is in the h6 style. Thanks!

    Only thing is that it seems to make 2 lines instead of 1 per entry.

    I now set the line-height to 0, that helps but still looks funny.

    Well, maybe I could get used to it… : ) Or there’s a tricks!?

    Thanks again! Way better than before.

    Maybe a link to the archive would help.

    You know what, I like it like that!

    At least this way you don’t accidentally click the wrong link.

    Plus it isn’t too ugly. Thanks again! Marked as resolved.

    Haha, now, while my Tidy-Plugin seems to be happy and gives me the big green check, I just did a test on and got 16 errors. Besides, my CSS doesn’t validate either. Well, it was worth a shot but I really wouldn’t know where to start. Also there are about 3 people that will use this site. So, whatever!

    Respect to all internet professionals, I would probably start to cut myself.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Please help me to validate! (Tell php to use CSS)’ is closed to new replies.