php文档头,头部文档(header.php)

- 使用正确的 [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(); ?>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值