【发布时间】:2014-07-17 13:13:20
【问题描述】:
所以我正忙于 Wordpress。我有一个网站和所有的主题。一切正常。然后我想激活新主题。 BENG BENG,白屏死机。我调试了,这是错误:
Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in C:\xampp\htdocs\wp-includes\functions.php on line 2944
第 2944 行只是引发错误的行。我已经检查过了。
有人遇到过并解决过这个问题吗?
编辑:
参考线:
function _doing_it_wrong( $function, $message, $version ) {
do_action( 'doing_it_wrong_run', $function, $message, $version );
// Allow plugin to filter the output error trigger
if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
$version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
$message .= ' ' . __( 'Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );
trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
}
}
【问题讨论】:
-
你能告诉我们网站引用的行吗?
-
错误地使用
wp_enqueue_script()不会触发致命错误。最重要的是,仅当您将WP_DEBUG设置为 true 时才会显示错误。主题肯定有其他问题。
标签: wordpress