0

我收到这样的通知错误:

注意:wp-content/themes/aquasize/admin/library/engines/typography-engine.php:66 - 未定义变量:样式表

注意:wp-content/themes/aquasize/admin/library/engines/typography-engine.php:70 - 未定义变量:样式表

这是我的完整代码: http: //pastebin.com/VsrHzjJ6

这是第 66 行:

 preg_match("/\.css/i", $stylesheet, $matches);

这是第 70 行:

  if( $stylesheet ) wp_enqueue_style( $font, $stylesheet, 1, 2 ); 

我尝试修复但在最新的 PHP 版本上失败了。非常感谢您的所有帮助。谢谢

4

1 回答 1

0

尝试添加:

/**
 * This will log all errors notices and warnings to a file called debug.log in
 * wp-content (if Apache does not have write permission, you may need to create
 * the file first and set the appropriate permissions (i.e. use 666) )
 */
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);

在您的开发安装中的 wp-config.php 文件的顶部附近。

更新

这些是通知和警告而不是错误。要么定义变量,要么关闭通知的错误报告。

请尝试在全局代码之上定义它。或者在调用函数之外定义。

$stylesheet= "";
于 2013-03-07T16:15:35.423 回答