WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Validation Errors Stemming from Widgets (10 posts)

  1. lauralohr
    Member
    Posted 6 years ago #

    I was having many errors on my validation. I tried and tried within my own code to no avail.

    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.

  2. moshu
    Member
    Posted 6 years ago #

    I see 16 errors... and they all come from the same mistake you had from the beginning:
    http://automattic.com/code/widgets/themes/

    Notice that BEFORE the dynamic sidebar code and right AFTER it there is the opening <ul> and the closing </ul>, respectively.
    Add those and you should be closer to validation :)

  3. lauralohr
    Member
    Posted 6 years ago #

  4. lauralohr
    Member
    Posted 6 years ago #

    The ones on http://www.lauralohr.com/wordpress are as is, because I have not made the changes to the widget on my live theme because I was up all night combing through code trying to fix it.

  5. moshu
    Member
    Posted 6 years ago #

    Just put the closing </body> tag where it should be (at the end of the code) and half of it will be corrected :)

  6. lauralohr
    Member
    Posted 6 years ago #

    Moshu,

    Thank you for all your help with all of this. My problem is that I have a body tag at the end of that code.

    <!--we need this for plugins-->
    <?php wp_head(); ?>
    </head>
    
    <body>
    <div id="container">
    <div id="header">
    	<!--<div class="title"><a href="<?php echo get_settings('home'); ?>/"><?php bloginfo('name'); ?></a></div>-->
    	<!--<div class="description"><?php bloginfo('description'); ?></div>-->
    	<div id="menu">
    	<ul>
    		<li class="home"><a href="<?php echo get_settings('home'); ?>">Home</a></li>
    		<?php wp_list_pages('title_li=&depth=1'); ?>
    		<li><a href="<?php bloginfo('rss2_url'); ?>">Feed</a></li>
    	</ul>
    	</div>
    </div>
    </body>
    <!--header.php end-->

    I have tried every combination and several different header files/code combinations and nothing will make it validate.

    Again, thank you for your attention today and yesterday. You have been very kind and helpful. I totally appreciate that!

  7. moshu
    Member
    Posted 6 years ago #

    I don't know who made that theme - but the person has no clue about HTML.
    You can NOT have that closing </body> there!
    Delete it.
    You need the closing body tag in the footer.php rigfht before the closing </html> tag.

  8. lauralohr
    Member
    Posted 6 years ago #

    Holy crap! That totally worked! Looking at the original code there was no </body> element in the header.php, but it also was not in the footer.php either. Which means {{{{turns away in shame}}}} that I was the one (ass) that did not know where to put it.

    I am, however, getting a new </body> error:

    Error Line 344, column 6: end tag for "div" omitted, but OMITTAG NO was specified .

    </body>

    I am down to two errors. This is huge for me.

  9. moshu
    Member
    Posted 6 years ago #

    At the very bottom of your sidebar there is a missing closing </ul>.

    The other is NOT a body error... the /body is used to show you where the missing </div> should be - according to the validator.

  10. lauralohr
    Member
    Posted 6 years ago #

    YEEEEEEEEEESSSSSS!

    Thank you! You are totally awesome and I am totally validated.

    My page is a bit broken right now, but I think that might be something a bit of css will fix.

    I am eternally grateful!

Topic Closed

This topic has been closed to new replies.

About this Topic