[wp-hackers] Wordpress 3.7.1 and html5 W3C validation

Olivier Baudry olivierbaudry.eba at hotmail.fr
Mon Nov 18 15:17:31 UTC 2013


Dear all

It is not possible to have a valid wordpress website with wordpress
html5, indeed, there is a conflict between the first line of code in the
header php theme_compat included in the folder (wp-includes) and themes
that can be developed that it would be well to provide these w3C
compatible files or delete the whole record, and finally assurrer
compatibility and recognition and validation by the W3C in effect

in header. php included in theme_compat folder you have  actually :

<code>
<?php
/**
 * @package WordPress
 * @subpackage Theme_Compat
 * @deprecated 3.0
 *
 * This file is here for Backwards compatibility with old themes and
will be removed in a future version
 *
 */
_deprecated_file( sprintf( __( 'Theme without %1$s' ),
basename(__FILE__) ), '3.0', null, sprintf( __('Please include a %1$s
template in your theme.'), basename(__FILE__) ) );
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type');
?>; charset=<?php bloginfo('charset'); ?>" />

<title><?php wp_title('«', true, 'right'); ?> <?php
bloginfo('name'); ?></title>

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>"
type="text/css" media="screen" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />


</code>


You will notice that the problem of a charset to be utf-8 more languages
attributes that conflict. then have a head tag inside when there are
opening and closing head tags in most wordpress themes does not help.
Hence my question is when that Wordpress has matured to be fully valid
by the W3C html5 css3?
You notice that a code is valid for html5 should be formed so ( see
below right version in green)

<code> ?php
/**
 * @package WordPress
 * @subpackage Theme_Compat fully html5
 * @deprecated 3.0
 *
 * This file is here for Backwards compatibility with old themes and
will be removed in a future version
 *
 */
_deprecated_file( sprintf( __( 'Theme without %1$s' ),
basename(__FILE__) ), '3.0', null, sprintf( __('Please include a %1$s
template in your theme.'), basename(__FILE__) ) );
?>
<!DOCTYPE html>

|
<html>
    <head>
        <meta charset="utf-8" />
  |



<title><?php wp_title('«', true, 'right'); ?> <?php
bloginfo('name'); ?></title>

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>"
type="text/css" media="screen" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />


</code>

To conclude, it would be good wordpress leave the choice of many
developers code their header.php file to BE fully W3C valid, the theme
compat doosier poses more problems than it solves. and free the
developer to use xhtml, html5 or other.




More information about the wp-hackers mailing list