验证 XHTML 是从零开始创建 WordPress 主题系列教程的第八篇。在开始学习 CSS 并修改 style.css 文件之前,我们需要学习如何验证代码,简单说,验证(Validate/Validating/Validation)就是检查下代码有没有错误,而验证又分为:XHTML Validator 和 CSS Validator。这篇我们学到 XHTML 验证器。
首先打开 Xampp Control 和浏览器,并进入 http://localhost/wordpress。
然后查看 > 页面源代码。
全选并所有的源代码。
然后到 XHTML Validator。
把刚才复制的源代码粘贴到 Validate by Direct Input 框中。

点击 Check 之后,验证器会就会检查代码,然后把检测结果反馈给我们。如果反馈回来的结果是绿色的,那么代码没有错误。

如果有错误,则根据其提示进行修改。
原文:link

在上一篇窗体化侧边栏,使用了Widget 插件,是不是会使验证出现问题?
阅读教程9时提示错误信息
Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ in /www/denis/wwwroot/wp-content/themes/Blix/header.php on line 115
我在修改东西,现在没有问题了!
请问个问题,我有copy此段代码,但出现43个error,我实在看不出来是什么问题,可否帮忙解释一下,谢谢!
<meta http-equiv="Content-Type" content="; charset=" />
<meta name="generator" content="WordPress " />
<link rel="stylesheet" href="" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="" />
<link rel="alternate" type="text/xml" title="RSS .92" href="" />
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="" />
<link rel="pingback" href="" />
<a href="">
<div class="post" id="post-">
<a href="" title="">
<?php wp_list_pages('depth=3&title_li=Pages'); ?>
Copyright © 2008
我有46个错误,但大多数都是”与”还有“>”的问题,请问如何改呢,是在index.php里还是?
我也有。。怎么办啊,,
41个错误,头都晕了,而且全是英文,老大可以发一个index.php,标准版的文件吗?没有错误就好了
9个错 一个警告 验证是验证了 可都是英文 完全不晓得怎么改(比如)
Line 205, Column 372: there is no attribute “width”
…”application/x-shockwave-flash” width=”257″ height=”33″ src=”http://www.xiami.…✉
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the “Strict” document type with a document that uses frames (e.g. you must use the “Transitional” document type to get the “target” attribute), or by using vendor proprietary extensions such as “marginheight” (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the element to incorporate flash media in a Web page, see the FAQ item on valid flash.
很多错误都是符号的,而且是PHP生成的,怎么改呢?
Using Direct Input mode: UTF-8 character encoding assumed
Unlike the “by URI” and “by File Upload” modes, the “Direct Input” mode of the validator provides validated content in the form of characters pasted or typed in the validator’s form field. This will automatically make the data UTF-8, and therefore the validator does not need to determine the character encoding of your document, and will ignore any charset information specified.
If you notice a discrepancy in detected character encoding between the “Direct Input” mode and other validator modes, this is likely to be the reason. It is neither a bug in the validator, nor in your document.
一处警告请问是什么意思
都是些>、<这样的错误。。。
我也遇到了类似问题,不过我觉得都是你们不细心所导致的,不怪Denis不回你们,我的QQ:107665773 ,如果需要帮忙请加我,就当温习我所学到的知识,备注是从水煮鱼这里看到的。
我吧 denis 给的index.php 去验证也有n多错误… 无奈了 http://www.wpdesigner.com/wp-content/files/wp-tutorial/index-2007-march-02.txt