WordPress 版本 3.3 发布已有一个星期了,前些天有朋友问到 WP 主题在加载脚本与样式表时报错的问题,报错内容如下(需开启 WP_DEBUG 模式):
Notice:
wp_enqueue_scriptwas called incorrectly. Scripts and styles should not be registered or enqueued until thewp_enqueue_scripts,admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.)

According to all the comments about
在许多场合中,不管是制作修改主题或插件,我们都需要调用一些 JavaScript 库,或者样式表等。这时,我们不应该直接去修改主题的 header.php,或者添加代码到
笔者的 WP 主题处女作 Nest 已于 2011 年 7 月 10 日正式被 WordPress 官方添加至其主题目录中。