• Resolved goldmember

    (@goldmember)


    When i run my site through the Validator, I get the following Validation Errors.

    I’m not really sure how to fix these. I’m hoping someone can provide insite.

    Regarding the first error, it says to add a document type. so do i just add:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>

    and if so, which pages of my theme do i put it at the top of? index.php? single.php? page.php? others????

    Thanks!.
    P.S. WordPress newbie here so bear with me

Viewing 7 replies - 1 through 7 (of 7 total)
  • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes('xhtml'); ?>>
    <head profile="https://gmpg.org/xfn/11">
    
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <meta name="distribution" content="global" />
    <meta name="language" content="en" />

    all of this should be at the top of your theme’s header.php
    wonder why it isn’t

    Thread Starter goldmember

    (@goldmember)

    beats me. i probably screwed with it at one point when i shouldn’t have. regardless, i’m down to 5 errors now from 7. thanks!

    still though, my first and second errors are both still related to doctype. any idea how to fix?

    # Error Line 1, Column 1: no document type declaration; will parse without validation

    <div id="outer_wrapper">

    The document type could not be determined, because the document had no correct DOCTYPE declaration. The document does not look like HTML, therefore automatic fallback could not be performed, and the document was only checked against basic markup syntax.

    Learn how to add a doctype to your document from our FAQ, or use the validator’s Document Type option to validate your document against a specific Document Type.

    # Error Line 3, Column 3: “DOCTYPE” declaration not allowed in instance

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “https://www.w3.or

    you need to put the code supplied above this
    <div id="outer_wrapper">

    Thread Starter goldmember

    (@goldmember)

    i added it to the body of header.php, then revalidated and nothing changed.

    index.php, page.php and single.php already have <div id="outer_wrapper"> but they dont have

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes('xhtml'); ?>>
    <head profile="https://gmpg.org/xfn/11">
    
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <meta name="distribution" content="global" />
    <meta name="language" content="en" />

    do i need to add this to the top of all three of these pages or do something else? thanks!!!!!!!

    i added it to the body of header.php

    it should be the very 1st statement in your theme’s header.php then after that the remainder starting with
    <div id="outer_wrapper">
    that is the only file you need to put it in as it is called on every post/page, etc.

    Thread Starter goldmember

    (@goldmember)

    thanks. something is screwed up now though. if you look at https://www.goldcoastchamber.com/wordpress/ you’ll notice there’s a 1/2 white space above the banner.

    below all the code that starts my header.php page. any idea what’s wrong?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes('xhtml'); ?>>
    <head profile="https://gmpg.org/xfn/11">
    
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <meta name="distribution" content="global" />
    <meta name="language" content="en" />
    
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <title><?php bloginfo('name'); wp_title(); ?></title>
    <?php wp_head(); ?>
    </head>
    
    <body>
    <div id="outer_wrapper">
    Thread Starter goldmember

    (@goldmember)

    closing this thread. this discussion is going on elsewhere.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Sorting out validation errors’ is closed to new replies.