Forums

[resolved] Sidebar validation issues (17 posts)

  1. Haecceity
    Member
    Posted 6 years ago #

    My sidebar has validation issues, mostly with <li> elements. See: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.bodhipaksa.com%2Fblog%2F for a report.

    I've poked around can't figure out what the problem is. The sidebar code is at http://pastebin.com/656734.

    Any help much appreciated.

  2. Haecceity
    Member
    Posted 6 years ago #

    Bump.

  3. Samuel B
    moderator
    Posted 6 years ago #

    Hi,
    I don't see anything at pastebin.com.
    I'll look at your source code.

    **Edit**
    I have to go now - if no one helps you in the next few hours, email me and I'll work it out.
    samboll at yahoo dot com

  4. Haecceity
    Member
    Posted 6 years ago #

    Thanks for the offer, Samboll. I'll certainly email you. I'm not sure what's going on with pastebin. I'd assumed that it would save my code but it doesn't seem to "stick". I've never used it before so I may be missing something. Anyway, the email will be on the way in a couple of minutes.

  5. Samuel B
    moderator
    Posted 6 years ago #

    If you emailed me, it must have went in the junk folder.
    Try pastebin again or use the contact form on my website. It's just a test blog for a customer, but it's fully functional.

  6. Haecceity
    Member
    Posted 6 years ago #

    Boy! Okay, I used the contact form on comeuphither and hopefully that'll get to you. I mistyped my email address, which should end wildmind.org.

    Merci!

  7. Ajay
    Member
    Posted 6 years ago #

    Checked line 239:
    http://validator.w3.org/check?uri=http%3A%2F%2Fwww.bodhipaksa.com%2Fblog%2F&charset=%28detect+automatically%29&doctype=Inline&ss=1&verbose=1#line-239

    You will notice that after the closing </li> you immediately have a <ul>

    Remove that <ul> and its corresponding closing tag

  8. Haecceity
    Member
    Posted 6 years ago #

    Thanks Ajay. The problem is I can't find what in the php code is causing that <ul>. I think I now have pastebin working, and the URL is http://pastebin.com/659257.

  9. Samuel B
    moderator
    Posted 6 years ago #

    Hi,
    Sorry I haven't gotten back sooner.
    I can't find anything wrong with your sidebar.php. Do you have a plugin or something else adding code?
    I'll be gone for the weekend. Sorry I couldn't help you.

  10. Haecceity
    Member
    Posted 6 years ago #

    The only active plugins I have are Kimili flash plugin and Akismet. Neither of those should do anything to the sidebar.

    Anyone else have any ideas?

  11. Ajay
    Member
    Posted 6 years ago #

    The problem is around the code at background. I don't know what is generating it, but the background sections is getting enclosed in the <ul>

  12. Haecceity
    Member
    Posted 6 years ago #

    Interesting. That part of the sidebar code isn't in
    <ul> or <li> tags at all for some reason. I'll try playing around with it and see what happens. Many thanks.

  13. Ajay
    Member
    Posted 6 years ago #

    Open up all the files in your theme and find out where it is.

    It could be in index.php or home.php if it is not in the sidebar.php

  14. Haecceity
    Member
    Posted 6 years ago #

    What I meant is that the code is in the sidebar, but it's not in list tags.

    Anyway, I changed <?php wp_list_pages('title_li=<h2>Background</h2>' ); ?>

    to

    <li><h2>Background</h2></li>
    <ul>
    <?php wp_list_pages('title_li=' ); ?>
    </ul>

    It renders fine on the page and gives the following html:

    <li><h2>Background</h2></li>
    <ul>
    <li class="page_item"><a href="http://www.bodhipaksa.com/blog/about/" title="About Bodhipaksa">About Bodhipaksa</a></li>
    </ul>

    However, this makes no difference to the number of validation errors.

  15. Haecceity
    Member
    Posted 6 years ago #

    Ha! Got it fixed. I'd misplaced a </li> tag.

    I also hadn't made the code for an image self-closing. The sucker now validates!

  16. Ajay
    Member
    Posted 6 years ago #

    Congrats!

  17. Haecceity
    Member
    Posted 6 years ago #

    The problem was some code that I think I largely copied from another post on the forum -- but maybe I messed it up myself. The nonvalidating version was:

    <ul><?php query_posts('cat=6&order=ASC&showposts=-1'); ?>
    <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    <?php endwhile; endif; ?></li>
    </ul>

    Which should have read:

    <ul><?php query_posts('cat=6&order=ASC&showposts=-1'); ?>
    <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endwhile; endif; ?>
    </ul>

    It was the </li> that was the problem.

    It was interesting how one glitch could cause multiple instances of nonvalidation.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags