WordPress.org

Ready to get started?Download WordPress

Forums

My Site wont Validate (8 posts)

  1. newbie1konobie
    Member
    Posted 3 years ago #

    Hi Guys

    Im very very new to wordpress. I had a very basic understanding of dreamweaver, but have been converted to wp and I love it. This is only the 3rd website I have ever built. http://sunrisebg.co.uk. Now when I used to validate a website in dreamweaver using w3c, if there was a problem I would just revalidate it and copy and paste the clean html... sorted. I cant do that with wordpress but more importantly when I try to validate any page on my site i get this message

    "Sorry, I am unable to validate this document because on line 137 it contained one or more bytes that I cannot interpret as utf-8"

    any ideas or help please, In easy terms as well because I'm sooooooo new to this lol

    many thanks :-)

  2. View source on your page, dump it into a text editor, see what is at line 137: your "Skype Me" links have garbage characters in them.

  3. newbie1konobie
    Member
    Posted 3 years ago #

    Hi songdogtech

    Thanks so much for your quick response. I disabled the skype widget and it then tried to validate, this time no problem at all. I replaced the widget with plain html code from the skype website.

    Now when I validate it says I have errors. As I mentioned in my first post. In dream Weaver I would just copy the validated text from w3c validator and overwrite the old html in dreamweaver, that's it clean code.

    How do I do this in wordpress and again I'm very new to wordpress and just starting to find my feet

    once again thanks for your help

  4. WordPress's html is generated dynamically. Dreamweaver is for static html pages. You need to look into the php that is in the theme files to be able to fix some errors.
    http://codex.wordpress.org/Theme_Development

    You can cut and paste code to some degree. For instance, the code errors you have now are mostly from unencoded ampersands, so you might be able to cut and paste the Ratepoint iframe code that has the errors, change the & to &amp and then past that code into a plain widget rather than using the Ratepoint widget itself.

  5. newbie1konobie
    Member
    Posted 3 years ago #

    Hi Songdogtech

    Im getting there slowly. Now every page only has one error and its the the last two tags that seem to be giving me problems

    "Line 262, Column 7: end tag for "div" omitted, but OMITTAG NO was specified
    </body>"

    1 page my car hire page http://www.sunrisebg.co.uk/car-hire-bulgaria shows 15 errors but all the errors point to the same line and says

    "Line 273, Column 8: end tag for "script" omitted, but OMITTAG NO was specified
    </html>" or 15 slight veriations of the same fault on the same line

    Sorry for sounding so stupid, but I have been trying, any ideas? thanks for getting me this far. was pretty easy once you pointed me in the right direction to sort out most of the other errors, just this one now :-)

  6. newbie1konobie
    Member
    Posted 3 years ago #

    HI songdogtech

    I have sorted it, took me all morning but the problem was this.

    on the page http://www.sunrisebg.co.uk/car-hire-bulgaria ihave a search form for car hire. the old code looked like this

    <div class="textwidget">
    <script type='text/javascript'>
    var w_lang='en';
    var w_width='500';
    var w_height='220';
    var w_id='29';
    </script>
    <script src='http://widget.yma-bg.com/widget/scripts/widget.js' type='text/javascript'></script>
    </div>

    After working out this was the problem as when I removed it the page validated. I kept the same code but but tags at the top and bottom so the code now looks like this

    <!-- START WIDGET FORM REFERRAL -->
    <div class="textwidget">
    <script type='text/javascript'>
    var w_lang='en';
    var w_width='500';
    var w_height='220';
    var w_id='29';
    </script>
    <script src='http://widget.yma-bg.com/widget/scripts/widget.js' type='text/javascript'></script>
    </div>
    <!-- END WIDGET FORM REFERRAL -->

    It was probably a simple mistake but as Im new it did confuse me for a few hours, but all sorted now

    Many thanks :-)

  7. Jay August
    Member
    Posted 3 years ago #

    Not completely, older browsers will trip over that JavaScript.

    Add comment statements around the JS:

    <script type='text/javascript'>
    <!--
    var w_lang='en';
    var w_width='500';
    var w_height='220';
    var w_id='29';
    //-->
    </script>
  8. Good sleuthing. Valid code makes Google happy.

    The widget developer added those comments to escape the code from the validator. This format is more standards compliant and can be used for any javascript:

    <script type='text/javascript'>
    /* <![CDATA[ */
    var w_lang='en';
    var w_width='500';
    var w_height='220';
    var w_id='29';
    /* ]]> */
    </script>

Topic Closed

This topic has been closed to new replies.

About this Topic