WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Validating Widget Errors (10 posts)

  1. lauralohr
    Member
    Posted 6 years ago #

    I am trying to get my page validated and do not know how to fix the widget errors I am getting.

    What I mean to say, is that I am unsure where to put the

      and
    that are associated with the
  2. items that are in the sidebar. (I hope that is clear)

    My website is: Laura Lohr and is completely broken right now. I am trying to validate but am quite stumped what to do to correct these last 16 errors.

    Your wisdom and assistance are greatly appreciated!

  • lauralohr
    Member
    Posted 6 years ago #

    I have been searching for the answer to this from every message board and every web designer I can contact. I have tried everything.

    ANYONE?

    That was I am having problems with the
    unordered list tags and line item elements

      and

    The links widget is giving me the following error:

    <li class="links widget widget_links"><h2 class="widgettitle">Laura</h2>
    
    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
    
    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
  • moshu
    Member
    Posted 6 years ago #

    Well, not having a closing </head> and an opening <body> tag in your markup... is always a bad start.

    Just click the Show source boc on the validation page and Revalidate - all the line #s will become a clickable link, to admire the results:)

  • lauralohr
    Member
    Posted 6 years ago #

    Thanks for your response.

    I had not tried to click Show Source before. That was magical.

    The reason I took out the </head> and opening <body> tag is that it broke my layout. I cannot figure out how to get it work with the markup correct. I just put them back in and now everything is outside of the container (content, sidebar, footer, etc).

    ETA: I added them back in with the <div id "container"> tag. But, now I am getting a new error for the head and body.

  • moshu
    Member
    Posted 6 years ago #

    Well, you ca NOT have a valid html page/site without those tags. That's not a way to correct the errors.

    If yoou have it with the head and body back - I can see your site correctly in FF. But for pages that long I don't look at the source, sorry.

  • lauralohr
    Member
    Posted 6 years ago #

    I know I have to have the tags. I have literally tried EVERYTHING to have it both ways.

    I still have the errors on the widgets though. Any ideas why I am getting the error repeatedly:

    Error Line 99, column 37: document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag .

    <li class="links widget widget_links"><h2 class="widgettitle">Upcoming Races</..

    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "", "<span>", or "<font>").

  • moshu
    Member
    Posted 6 years ago #

    Every list has to start with <ul> (if unordered as in a WP sidebar).
    Yours is missing that.

  • lauralohr
    Member
    Posted 6 years ago #

    OMG! Thank you so much. I appreciate all your feedback. I needed a fresh pair of eyes. I just realized the code I am utilizing for the blogroll is <?php get_links; ?>. I suspect that is where my problem lies.

    I am off to change the code to <?php wp_list_bookmarks; ?>

    I suspect my problems with those errors will be resolved shortly.

    My navigation/menu bar is actually placed UNDER the header now too. I have been trying to fix that for two days now!

    THANK YOU! THANK YOU!

  • Root
    Member
    Posted 6 years ago #

    Lol :)

  • lauralohr
    Member
    Posted 6 years ago #

    I discovered the problem was not me at all, but several problems with the widget.php file.

    These are the problems I ran into:

    1. The "onchange" command for the archive dropdown was listed as "onChange" which caused several errors.

    2. <script language="Javascript"> is written as <script lang="Javascript">

    3. Even written correctly, <script language="Javascript"> is a deprecated tag and should be <script type="text/javascript"> to render no validation errors.

    4. I was getting an error similar to this one TWENTY-SEVEN TIMES (that is 27 errors):

    Error Line 481 column 8: ID "links" already defined.
    <li id="links" class="widget widget_links"><h2 class="widgettitle">www</h2>

    It was also telling me that my li were missing ul's (which they weren't, it was the widget.php causing the problem). Finally, after combing through many websites, forums, posts, asking for help and getting nowhere, I found this:

    - On wordpress 2.2.1 you have to add :
    $before_widget = preg_replace('/id="[^"]*"/','id="%id"', $before_widget);
    before line 397 (after the } else { )

    That error does not appear to have been fixed in the new release of WordPress.

    I am down to 3 errors and have had no success in getting any help clearing those.

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags