WordPress.org

Forums

Validating XHTML help (28 posts)

  1. mordak
    Member
    Posted 9 years ago #

    Hi I am down to my last 8 errors and don't know how to fix them. Can someone help me by explaining what I should do for my blog which can be found at alternativetosanity.com

    thanks,

    @S

  2. Nazgul
    Member
    Posted 9 years ago #

    You have a </head> in your footer. Change that to </body>.

    In your header, just above the line <div id="page"> add the following:
    </head>
    <body>

    Start with this and see where it gets you.

  3. mordak
    Member
    Posted 9 years ago #

    Thank you. I tried that and it still similar errors.

  4. Nazgul
    Member
    Posted 9 years ago #

    You went down from 9 to 4 errors' so it's a start.

    Next: Add a <title>Some Text Here</title> section within your <head>...</head> section.

    And add a </ul> above this line in your sidebar
    <div id="text-3" class="widget widget_text"> <h2 class="widgettitle">Page Rank</h2>

  5. Doodlebee
    Member
    Posted 9 years ago #

    1) you have no opening body tag. Oh wait, you do - but it's halfway down the page - right above the "sidebar2" div. What's that all about? You shouldn't start *any* content on a page without an opening body tag - inyour case, one that's in the right place! How did it get down inside of your content?

    2) under div id="sidebar" (at the bottom of the page) you're missing some closing tags:

    <div id="sidebar">
    <ul>
    <li id="linkcat-1"><h2>Blogroll</h2>
    <ul>
    <li><a href="">One in the Evening</a></li>
    <li><a href="">Urban Semiotic</a></li>
    ...etc...
    </ul>
    </li>
    <li id="linkcat-2"><h2>Forums</h2>
    <ul>
    <li><a href="">Alternative to Sanity Forums</a></li>
    <li><a href="">The Frozen Far</a></li>
    </ul>
    </li>
    <!-- you need closing tags here - you're missing a </ul> tag right in this spot -->

    Try starting with those two issues and see if it doesn't clear some stuff up.

  6. mordak
    Member
    Posted 9 years ago #

    I added the title line but I can't find that line in my sidebar. I am using the widgets and so I think that affects it.

  7. mordak
    Member
    Posted 9 years ago #

    okay I can't seem to edit that part either

  8. mordak
    Member
    Posted 9 years ago #

    This is my first blog and I am just using a standard theme and using the plugins found on the Codex.

  9. yosemite
    Member
    Posted 9 years ago #

    Looks like your down to 2 errors, getting close ;')

  10. mordak
    Member
    Posted 9 years ago #

    Hehe. getting very close I just can't find the place to edit those last 2 errors. One is part of a widget and the other is part of the WordPress blog roll

  11. mordak
    Member
    Posted 9 years ago #

    Doodlebee, I have no idea how it got down there and wouldn't even begin to know where to look or how to fix it. hehe. I'm a total noob.

  12. mordak
    Member
    Posted 9 years ago #

    Anyone familiar with the sidebar widgets know where I should go to correct those last 2 errors?

  13. yosemite
    Member
    Posted 9 years ago #

    Missing a li?

    Presentation:Sidebar Widgets

    You've got a text widget there (prolly the one with the amazon code). It looks like it might be missing an opening li. If it's not obvious, cut and paste it here (between backticks).

  14. mordak
    Member
    Posted 9 years ago #

    I have edited the actual text for the sidebar text widget and it tells me i can't put an li there.

    here is the actual text

    <a href="http://pr.blogflux.com/"><img src="http://pr.blogflux.com/pr.php" alt="Google PageRank Checker Tool" width="80" height="15" border="0" /></a>

  15. Doodlebee
    Member
    Posted 9 years ago #

    Your issues are here, in this area:

    <div id="text-3" class="widget widget_text"> <h2 class="widgettitle">Page Rank</h2>

    You have a list there:

    <div class="textwidget">
    <li>
    <a href="http://pr.blogflux.com/">...

    You're opening your <li> without a <ul> or <ol> tag, which causes the invalidation. Anytime you have a <li>, you have to be sure you have the beginning list tags.

    Then it says for that <li> tag, you don't have a closing </li> tag. If it's open, it's gotta be closed.

  16. yosemite
    Member
    Posted 9 years ago #

    doodlebee has a +3 css wand.

  17. Doodlebee
    Member
    Posted 9 years ago #

    Yosemite - you lost me there. Although, for some reason, the comment makes me feel muchly like a Harry Potter character.

    I need more sleep. ;)

  18. mordak
    Member
    Posted 9 years ago #

    I understand what you are telling me Doodlebee but I have no idea where to edit that line as it is part of my widgets. I will take a look in the plugins folder perhaps they store it there.

  19. yosemite
    Member
    Posted 9 years ago #

    mordak: Presentation:Sidebar Widgets, then find your Page Rank widget, configure...

    db: (translation: You're better with css then me ;')

  20. mordak
    Member
    Posted 9 years ago #

    I am beginning to really feel like an idiot. When I got to Presentation:Sidebar Widgets and look at my Page Rank widget I don't have access to the part of the HTML code that needs fixing. This is all that is there:
    <a href="http://pr.blogflux.com/"><img src="http://pr.blogflux.com/pr.php" alt="Google PageRank Checker Tool" width="80" height="15" border="0" /></a>

    Maybe I am missing something.

  21. yosemite
    Member
    Posted 9 years ago #

    I'm always missing something. If I was experiencing what is described here, I'd check my sidebar.php file.

    Made any edits to that?

  22. Doodlebee
    Member
    Posted 9 years ago #

    I don't have the "Page Rank" widget myself, but I do have others that I had to work around for LI issues and such. Here's what I did to get mine going the way it should:

    Go to your "Theme Editor"

    Select your "Sidebar" to edit

    (I'm going to use my "Recent Posts" section as an example - it's also a list, and prior to my editing, it wouldn't validate)

    Look for your "page rank" section - which probably looks something like <?php page_rank(); ?> - I don't know *exactly* what it looks like - because, like I said, I don't have this widget, but you can probably decipher which section it's in in your sidebar.

    Now, using my "Recent Posts" section as an example (you'll have to make it fit your situation) I wrapped it in the UL tags necessary to produce the correct, valid markup. So it went from this:

    <?php $posts = get_posts('numberposts=10&order=DESC&orderby=post_date');
    foreach ($posts as $post) : start_wp(); ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>

    To this:

    <div id="posts">
    <div class="title">Recent Posts</div>
    <ul>
    <?php $posts = get_posts('numberposts=10&order=DESC&orderby=post_date');
    foreach ($posts as $post) : start_wp(); ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>
    </div>

    The extra divs there are my own (so you don't need those unless you *want* them) - but note the addition of the extra UL tags there. It adds in the correct markup to make it validate.

    Does that help a bit?

  23. mordak
    Member
    Posted 9 years ago #

    It does help a bit... however I still don't see what is described. HEHE... I really need a book or something :P

    Here is my sidebar code:

    <div id="sidebar">
    <ul >

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?>

    <li>
    <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    </li>
    <!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.

    <li><h2><?php _e('Author'); ?></h2>
    A little something about you, the author. Nothing lengthy, just an overview.
    </li>
    -->

    <li>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    You are currently browsing the archives for the <?php single_cat_title(''); ?> category.

    <?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
    You are currently browsing the <a>"><?php echo bloginfo('name'); ?></a> weblog archives
    for the day <?php the_time('l, F jS, Y'); ?>.

    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    You are currently browsing the <a>"><?php echo bloginfo('name'); ?></a> weblog archives
    for <?php the_time('F, Y'); ?>.

    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    You are currently browsing the <a>"><?php echo bloginfo('name'); ?></a> weblog archives
    for the year <?php the_time('Y'); ?>.

    <?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
    You have searched the <a>"><?php echo bloginfo('name'); ?></a> weblog archives
    for <strong>'<?php echo wp_specialchars($s); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.

    <?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) &&amp; !empty($_GET['paged'])) { ?>
    You are currently browsing the <a>"><?php echo bloginfo('name'); ?></a> weblog archives.

    <?php } ?>
    </li>
    <?php wp_list_pages('title_li=<h2>' . __('Pages') . '</h2>' ); ?>

    <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
    <?php get_links_list(); ?>

    <li><h2><?php _e('Categories'); ?></h2>
    <ul>
    <?php list_cats(0, '', 'name', 'asc', '', 1, 0, 1, 1, 1, 1, 0,'','','','','') ?>
    </ul>
    </li>
    <?php if (function_exists('wp_theme_switcher')) { ?>

    <li><h2><?php _e('Themes'); ?></h2>
    <?php wp_theme_switcher(); ?>
    </li>
    <?php } ?>

    <!-- Disabled calendar by default <?php get_calendar(); ?> -->

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

    <li><h2><?php _e('Meta'); ?></h2>
    <ul>
    <?php wp_register(); ?>

    <li><?php wp_loginout(); ?></li>
    <li>
    <a href="http://validator.w3.org/check/referer">"><?php _e('Valid XHTML'); ?></a></li>
    <li><a href="http://gmpg.org/xfn/">XFN</a></li>
    <li><a href="http://wordpress.org/">">WordPress</a></li>
    <?php wp_meta(); ?>
    </ul>
    </li>
    <?php } ?>

    <?php endif; ?>

    <div class="theme">

    <a href="http://aydin.net/blog/2006/02/13/wordpress-theme-three-column-black-letterhead/">3cbl</a> theme by <a href="http://aydin.net/blog">Hakan Aydin</a>
    </div>

    </div>

    Here is my sidebar2 code:

    <div id="sidebar2">
    <?php if ( !function_exists('dynamic_sidebar')
    || !dynamic_sidebar(2) ) : ?>

    <br><br>
    <center>

    </center>
    <br><br>

    <?php endif; ?>
    </div>

    I suspect I need to find where 'dynamic_sidebar' is but don't really know.

    Thanks for all your help by the way. I'm just a little daft at times.

  24. Doodlebee
    Member
    Posted 9 years ago #

    Yeah - I don't see your "Page Rank" code anywhere in there. Interesting..

  25. yosemite
    Member
    Posted 9 years ago #

    Looking at the sidebar.php file in the authors distro of theme, he has a between the last endif and the theme class, around line 85:

    <?php endif; ?>

    </ul>

    <div class="theme">

    I don't see it in your post above... Could it be getting stripped here?

    EDIT I think it is getting stripped here. bleh. Brain. Hurts.

  26. yosemite
    Member
    Posted 9 years ago #

    Might want to leave a comment for the theme author at
    http://aydin.net/blog/2006/02/13/wordpress-theme-three-column-black-letterhead/

    as well...

  27. mordak
    Member
    Posted 9 years ago #

    Hi Yosemite,

    yeah it is actually there. but for some reason it is being stripped out.

  28. yosemite
    Member
    Posted 9 years ago #

    The most I can do right now is make tugboat noises.

    Check this?: WordPress Troubleshooting: I have to validate? Oh MY!!

    Then report back how useless it was?

Topic Closed

This topic has been closed to new replies.

About this Topic