- 使用正确的 [DOCTYPE](http://en.wikipedia.org/wiki/Document_Type_Declaration).
- 开始标签应该包含 [language\_attributes()](http://codex.wordpress.org/Function_Reference/language_attributes).
- 字符集元素应该放到其他元素的上面,包括
元素。- 使用 [bloginfo()](http://codex.wordpress.org/Function_Reference/bloginfo) 设置 字符集和description元素。
- 使用 [wp\_title()](http://codex.wordpress.org/Function_Reference/wp_title) 设置
元素。 [查看原因](http://codex.wordpress.org/Function_Reference/wp_title)。- 使用 [get\_stylesheet\_uri()](http://codex.wordpress.org/Function_Reference/get_stylesheet_uri) 来获取当前主题的样式表文件。
- 使用 [Automatic Feed Links](http://codex.wordpress.org/Automatic_Feed_Links) 添加 feed 链接。
- 添加声明 [wp\_head()](http://codex.wordpress.org/Function_Reference/wp_head) 到 结束标签的前面。插件会使用这个动作钩子([action hook](http://codex.wordpress.org/Plugin_API/Action_Reference) )来加载它们的JS、CSS 和其他功能代码。
下面是一个格式正确的HTML5兼容的头部区域的例子:
1
2
3
4
5
6
7
8
9
10
11
12
>
<?php wp\_title(); ?>